Every person who shall, at any place within this state, ride or attempt to ride upon any locomotive engine, railroad car, railroad train, or trains of any character, in or upon any part thereof, for the purpose or with the intent of stealing a ride thereon, or who shall at any place, within this state, climb upon, hold to, or in any manner attach himself to, any locomotive engine or railroad car or railroad train or trains of any character, while the same are in motion, shall be guilty of a misdemeanor: provided, that this section shall not apply to any employee of a railroad company operating such train, locomotive or car, nor to any person operating such train, locomotive or car, nor to any person having business with, or acting under legal authority of, such railroad company.
Idaho Code § 18-4617