You may drive around a railroad crossing gate that is being lowered:

If gates are down at a railroad crossing, stay in place and do not try to cross the tracks until after the gates have been raised. It is against the law to drive around railroad crossing gates.
DMV Writen Test