When railroads still ran cabooses, you had a toilet in them. Basically a wood box with a toilet seat, a hole and a metal chute out the bottom of the car. The world was their toilet. Bet the gandy dancers loved finding that.
Also the practice on passenger trains until recently, still is in some countries. Toilets used to feature a sign saying "Do not use toilet while train is in station". And what do the cabooseless freight crews do? In some locomotives there is a toilet seat with a plastic bag underneath, which the crew take with them for disposal at the end of their sift.
I rode a Stokes litter up to a helo once, doing CPR all the way. Had to stay with the bird as they didn't have time to get me back to my boat. Turned out that it was a wasted trip but we never stopped trying. RIP