No person shall cross railroad tracks at a designated railroad grade crossing when warned by an automatic signal, crossing gates, flagman or law enforcement officer of the approach of a railroad locomotive, a railroad car or train or other equipment on the railroad tracks or when otherwise warned of the approach of such locomotive, car or train or equipment. Violation of this section shall be an infraction.