There's an interesting long article on the New York subway's signalling, and a video too.
https://www.youtube.com/watch?v=Mjx3S3UjmnAIt seems that safety is maintained by interlocking - whether mechanical or 300,000 relays depends on which part of the system you look at.
There's a simulator for Windows or OSX here:
http://www.nycsubway.org/wiki/NXSYS,_Si ... _SimulatorHere's the long article:
http://www.theatlantic.com/technology/a ... re/415152/