Any person who shall ride, lead or drive any cattle, horses or other animals upon any railroad protected by fences and guards as required by section 48:12-46 of this title and within such fences and guards elsewhere than at farm crossings, without the consent of the company, shall, for every such offense, forfeit ten dollars and pay all damages sustained thereby to the company, to be recovered in an action at law.
N.J.S. § 48:12-47