So when user is disconnected (by Disconnect user from Task Manager) the client session looses the actual GUI but the GUI thread keeps running on the server machine and consuming the lot of resources
I don't work with JavaFX but what seems to be happening is that you are just shutting down the connection to the Server machine with the Java app .
That doesn't shut down the app so it will continue to use resources.
If you want to shut it down from a client Windows context. You need to firs trigger the remote app shutdown and then disconnect.
Perhaps use a wrapper script or app on the server to start and shutdown the Server app from the client/Windows context menu ?
So instead of
I start my JavaFX application via Remote Desktop Services
, start a script or a wrapper java app that starts the JavaFX app .
If it is a wrapper app , create a shutdown method that first shuts down the JavaFX app then shut's itself down .