1. No person shall throw, dump, or cause to be thrown, dumped, deposited or placed upon any railroad tracks, or within the limits of the rights-of-way of any railroad, any refuse, trash, garbage, rubbish, litter or any nauseous or offensive matter.
2. Where a highway or road lies in whole or part within a railroad rights-of-way, nothing in this section shall be construed as prohibiting the use in a reasonable manner of ashes, sand, salt or other material for the purpose of reducing the hazard of, or providing traction on snow, ice or sleet situated on such highway or road.
3. A violation of the provisions of subdivision one of this section shall be punishable by a fine not to exceed two hundred fifty dollars and/or a requirement to perform services for a public or not-for-profit corporation, association, institution or agency not to exceed eight hours and for any second or subsequent violation by a fine not to exceed five hundred dollars and/or a requirement to perform services for a public or not-for-profit corporation, association, institution or agency not to exceed eight hours.
4. Nothing in this section shall be deemed to apply to a railroad or its employees when matter deposited by them on the railroad tracks or rights-of-way is done pursuant to railroad rules, regulations or procedures.