This is a fun little thing I built for the children’s museum.
The pool for the remote controlled boats always had this ledge at the back and two static cranes (made of really strong steel, may I add!) at the back.
The former director of exhibits decided this should be an interactive feature adding a goal for guests who are more skilled at controlling the boats to aim for.

When you succeed, the amber beacon light flashes and the train rolls over like it’s going to pick up cargo. After a few seconds it departs.

Yes, those yellow relays are the ones equipped with the surprise diode 😉
This is the solution I came up with for the train control. There are gaps in the third rail to allow isolation. I pulled the spaghetti out of the locomotive and wired the motors to the wheels.

It works great. Or, if you put the locomotive on the track backwards, it drives its coupler right through the drywall. BANG!! 😉