A railroad company operating a line of railroad in this state, which has failed or neglected to fence the road and to erect crossings and cattle guards, is liable for all damages sustained by a person as a consequence of that failure or neglect.
The measure of damages for failure to construct or maintain a fence is as follows: the owner of land abutting on the line of railway of the railroad company may serve notice on any of its station agents between April 1 and October 1 of any year, requiring the construction of a fence on the line between the person's land and the company's right-of-way. If the company does not construct the fence within 40 days after service of the notice, the landowner may recover from the company an amount not exceeding twice the cost of construction, with costs and reasonable attorney's fee, to be allowed by the court, or the landowner may construct the fence after the expiration of that time and receive from the company double the cost of construction, with like costs and attorney's fee.
The fence must be kept in repair by the railroad company in like manner and under like penalties as if built by the company.
Failure to serve notice does not relieve the railroad company from liability for damages for injuries to persons or domestic animals or other property, resulting from failure to fence its road.