If a railroad violates the provisions of N.H. Rev. Stat. § 377:12, it shall be guilty of a felony.