It shall be unlawful for any person to climb, jump, step, stand upon, or cling to, or in any other way attach himself to any locomotive engine or railroad car unless he works for the railroad corporation and is acting in the scope of his employment or unless he is a lawful passenger or is otherwise lawfully entitled to be on such vehicle.