Apparently there must be some current that runs thru the rails to detect trains going over it. So with a jumper cable, you can connect the two rails and make it look like a “train” is stuck on the tracks, and that will stop the trains.
Rather simple idea.