If you have ever been on a bus that comes to a railroad crossing, the driver stops before the railroad tracks and opens the door. The reason for opening the door is to listen for the three horn blasts that a train engineer is supposed to give when approaching a crossing. And why stop when there is a mechanical arm, which is called a "guarded crossing"?
Watch this train crossing video and you will understand why. And always note that if there are two tracks, which will be clearly marked, there might be a second train coming from the other direction, so do look both ways — just like we tell our kids when crossing a street.