I've built a huge Lego train layout which is fully automated by microcontrollers, Arduino. The passenger trains 7740 and 7745 ride around and after a while they stop at the station. The freight trains 7755 and 7760 intersect with the track of the 7745. A section of the track of the freight trains can be powered down: if the 7745 passes the intersection, the 7755 and the 7760 will stop.
The trains use PWM signals to start and stop. For starting is actually needed: otherwise the locomotive will disconnect from the wagons and drive away by itself.
Video:
http://youtu.be/cUcrXmiFyJE
I've built it in my living room so unfortunately I have to tear it down again :(