In the USA, staff were instructed to lock toilets when the train was stopped in a station and unlock them when the train was again underway. Mercifully, new trains no longer dump waste on the tracks. Instead, trains are fitted with chemical holding tanks.