Short answer:
Try running:
export DISPLAY="$(hostname).local:0"
That should allow xmgrace and gnuplot (and any other X client) to utilize Xming.
Explanation:
You should still be able to use Xming with WSL2 even on Windows 11, but you'll need to set the DISPLAY variable appropriately in order to make sure that X clients (e.g. xmgrace, gnuplot) display on the appropriate X server.
By default on Windows 11 with WSLg, DISPLAY=:0, which sends the traffic to localhost:0 where the X socket in /tmp/.X11-unix is symlinked to the WSLg X socket (which, as you've noticed, uses RDP with RAILS).
Since WSL2 runs inside a virtual network which is separate from the Windows network, you'll need to point DISPLAY to an interface on the Windows network. This interface can be found using the mDNS name for the Windows machine, which is typically the "computer name" + ".local". Under WSL, that's typically "$(localhost).local".
If that fails for some reason, try the more unwieldy version:
export DISPLAY=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null):0