Section 1097.14 Railroad crossings.
No person shall traverse any railroad crossing:
(a) when an audible or clearly visible electric or mechanical signal device gives warning of the immediate approach of a train;
(b) when a crossing gate is lowered or when a human flagman continues to give a signal of the approach or passage of a train;
(c) when a train approaching within approximately 1,500 feet of the crossing emits a signal audible from such distance and such train, by reason of its speed or nearness to such crossing, is an immediate hazard;
(d) when an approaching train is plainly visible and is in hazardous proximity to such crossing; and
(e) when a crossing gate is in the process of being opened or closed. No person, except an LIRR employee acting in the course of his duties, may cross LIRR train tracks other than at a railroad crossing maintained for public use by the LIRR or at a private crossing established pursuant to statute or written agreement with the LIRR.
and here is the punishment
Section 1097.15 Enforcement
c) Violation of these rules shall constitute an offense and shall be punishable by a fine not exceeding $50 or imprisonment for not more than 30 days or both. Public Authorities Law, section 1266(4).
You may want to watch this http://www.dumbwaystodie.com