(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. Every person convicted of a violation of this subdivision shall for a first conviction thereof be punished by a fine of not less than two hundred fifty dollars nor more than four hundred dollars or by imprisonment for not more than thirty days or by both such fine and imprisonment; for a conviction of a second violation, both of which were committed within a period of thirty months, such person shall be punished by a fine of not less than three hundred fifty dollars nor more than seven hundred fifty dollars or by imprisonment for not more than ninety days or by both such fine and imprisonment; upon a conviction of a third or subsequent violation, all of which were committed within a period of thirty months, such person shall be punished by a fine of not less than six hundred dollars nor more than one thousand dollars or by imprisonment for not more than one hundred eighty days or by both such fine and imprisonment.
(c) 1. Any person convicted of a violation of this section while driving any vehicle carrying passengers under eighteen years of age, any bus carrying passengers, any school bus or any vehicle carrying explosive substances or flammable liquids as a cargo or part of a cargo, shall, upon conviction of a first offense, be guilty of a class A misdemeanor, and shall, upon conviction of a second or subsequent offense committed within five years of the prior offense, be guilty of a class E felony. 2. Any person convicted of a violation of this section resulting in an accident which causes physical injury, as that term is defined pursuant to subdivision nine of section 10.00 of the penal law, serious physical injury, as that term is defined pursuant to subdivision ten of section 10.00 of the penal law, or death to another person, shall be guilty of a class E felony.
(d) Nothing contained in this section shall be construed to prohibit or limit the prosecution of any violation, crime or other offense otherwise required or permitted by law.