ultrasonic sensors for railway bars

I just don't think an ultrasonic sensor will work here. Is it beside the track, looking down the track or above the track? I would use 2 break beam sensors at a distance from either side of the crossing that would allow time for the gate to close before the train got there. The break beam sensors would look diagonally across the track so they would not see gaps between cars, and a third proximity type sensor to detect a train IN the crossing.