If approaching a railroad crossing that is being approached by a train, you should:

Never attempt to beat a train to a railroad crossing. It is very difficult to accurately judge the speed of an approaching train. If you come upon a crossing that is being approached by a train, you must stop and wait for the train to pass before you attempt to cross the tracks.
DMV Writen Test Logo