There's a thing that happens where people get "" trapped"" by automatic crossing gates. They get their car on the tracks as the gate closes in front and behind them. The gates are very weak so they could drive right through, but some sort of mental block often prevents this and so they stay there with their car on the tracks, sometimes not even thinking to get out of the car.
I think it's a lack of panic that does it. In that moment they're afraid of causing property damage and they aren't thinking about their own imminent demise. Probably because they see the gate before they see the train, and once they start thinking about the gate in front of them they get tunnel vision and struggle to switch focus to the more important thing coming at them from the side.
I guess it goes to show that stupid finds a way.