(a) Whenever any person driving a vehicle approaches a railroad grade crossing under any of the circumstances stated in this section, the driver of such vehicle shall stop within fifty feet but not less than fifteen feet from the nearest rail of such railroad and shall not proceed until he can do so safely. The foregoing requirements shall apply when:
(1) A clearly visible electric or mechanical signal device gives warning of the immediate approach of a railroad train;
(2) A crossing gate is lowered or when a human flagman gives or continues to give a signal of the approach or passage of a railroad train;
(3) A railroad train approaching within approximately one thousand five hundred feet of the highway crossing emits a signal audible from such distance and such railroad train, by reason of its speed or nearness to such crossing, is an immediate hazard;
(4) Any approaching railroad train is plainly visible and is in hazardous proximity to such crossing.
(b) No person shall drive any vehicle through, around or under any crossing gate or barrier at a railroad crossing while such gate or barrier is closed or is being opened or closed.
(c) Any person failing to comply with the requirements of this section is guilty of a misdemeanor, and, upon conviction thereof, shall be fined one hundred dollars or imprisoned for not more than ten days. The commissioner shall promulgate rules to further penalize those convicted of violating this section by levying three points against the violator's driver's license record: Provided, That if the electric or mechanical signal device is malfunctioning, this subsection shall not apply.