My understanding is this is sadly not as rare as you would hope around level crossings. Likewise with trains hitting cars on the tracks.
Some crossings have gates which make this much less likely, others do not and rely on flashing lights and the train horn to warn people of an approaching train.