(a) Offense. - A person commits the offense of trespassing on
railroad right-of-way if the person enters and remains on the railroad right-of-way
without the consent of the railroad company or the person operating the
railroad or without authority granted pursuant to State or federal law.

(b) Crossings. - Nothing in this section shall apply to a person
crossing the railroad right-of-way at a public or private crossing.

(c) Legally Abandoned Rights-of-Way. - This section shall not
apply to any right-of-way that has been legally abandoned pursuant to an order
of a federal or State agency having jurisdiction over the right-of-way and is
not being used for railroad services.