I've always been perplexed when that happens. Seems pretty obvious to avoid. STAY OFF THE TRACKS! Trains and streetcars usually travel in one direction, straight ahead. No swerving, no quick turns and slow braking. Uh hello drivers?! I was a witness to such a thing several years ago on Spadina here in Toronto. Streetcars run down the middle of the road. At the time cars could venture on to the tracks. One idiot woman in her minivan thought she could quickly do a u-turn and beat an oncoming streetcar. *SMUNCH* She wasn't seriously hurt but was whailing away. Didn't feel sorry for her at all. Probably tied up traffic for an hour or so. Hopefully her insurance skyrocketed and got charged.
Due to the number of such "accidents" ugly green poles were put up along most of the way to prevent cars making such turns. Later they were thankfully ditched for a raised concrete curb.
Idiots.
Then there was the recent moron who despite railway crossing signs blinking and blaring he left his van on the tracks while in traffic. Well guess what happened? Gee a train appeared and plowed into his van. He was unhurt but his wife and two year old kid had some injuried as they were on the passenger side of the van where it was hit. Had the wife been in the front seat she would likely have died. Yeah there were no barriers at the crossing but the lights and sounds including the train horn should be a tipoff that a train is coming. Even then when you see the train, GET THE FUCK OUT OF THE VAN!