Maryland Transportation Section 21-701
§ 21-701.
  (a)   (1)   If the driver of a vehicle approaches a railroad grade crossing under any of the circumstances stated in paragraph (2) of this subsection, the driver:
      (i)   Shall stop within 50 feet but not less than 15 feet from the nearest rail in the crossing; and
      (ii)   May not proceed until he can do so safely.
    (2)   The requirements of this subsection apply if:
      (i)   A clearly visible electric or mechanical signal device warns of the immediate approach or passage of a railroad train;
      (ii)   A crossing gate is lowered;
      (iii)   A flagman signals the approach or passage of a railroad train;
      (iv)   A railroad train approaching within 1,500 feet of the crossing gives a signal audible to traffic approaching the crossing and the railroad train, because of its speed or nearness to the crossing, is an immediate danger; or
      (v)   A railroad train is plainly visible and is in or is approaching dangerously near to the crossing.
  (b)   A person may not drive any vehicle through, around, or under any crossing gate or barrier at a railroad grade crossing while the gate or barrier is closed or is being opened or closed.