The ban on passing near a railroad applies on the crossing itself and on the stretch within 100 meters before it. When approaching a crossing, the driver must see the tracks and the gate and be able to stop in time, and passing, which takes you out of your lane, gets in the way of that. More than 100 meters from the crossing this ban does not apply, but other limits on passing still apply if there are any on that stretch