I have ridden in the cab of Amtrak trains out of Chicago and the engineers have to witness near misses almost every single day. I don't know if they get over seeing near misses but I didn't. Seeing a dumb**s adult on a bicycle going around the gates wearing headphones, never noticing the train bearing down at 70+mph will make you cringe and probably not ever forget what you just saw. That one was so close I literally closed my eyes. We couldn't have missed that joker by more than 2 feet. With, strobes, ditch lights and a 5-chime horn blaring away long & strong these people will still wander out in front of speeding trains.
I think that Europeans have installed barriers that pop up preventing someone from wandering onto the tracks while a train is coming. I see that as the only sure deterrent to the pedestrian and bicycle "unintentional suicides". I suppose it would also work for vehicles, although we're talking serious capital investment now. What's the ultimate answer?