In case anyone is wondering: yes, this is how train robberies operated in the Old West. Slip the switch after the locomotive passes by, passenger cars are stuck there. They could rob everyone and get away before the locomotive could even stop and reverse back to the passenger cars.
And in case you were also wondering: yes, this tactic is still used by people stealing UPS packages from trains in various American cities today.