How can I run Gnome or KDE locally in Cygwin?

Did you make sure that the last command in your .xinitrc is not sent to the background.

For example to start the clock and a terminal window, you would put

xlock &
xterm

Nota bene: xclock has the ampersand to allow the xinit script to fall through to the next command. xterm is the last one in the chain and does not get th ampersand. As soon as this specific xterm is closed, the X-Server will terminate.

So if all your x-programs in xinitrc have the ampersand, the X-Server will immediatly shut down again after the last command in xinitrc.

This would look like the behavior you are seeing.