When approaching a railroad crossing controlled by flashing red lights, you should:

Railroad crossing signs are used to warn drivers about the possibility of an approaching train. Drivers must obey all railroad crossing warning signs and lights and should never try to drive around barriers.
DMV Writen Test