A railroad corporation that pays to the owner of the land through or along which its road is located an agreed price for making and maintaining a good and sufficient fence, or that pays the cost of such fence with the award of damages allowed for the right of way for the railroad, is relieved and exonerated from all claims for damages arising out of the killing or maiming of any animals of persons who thus fail to construct and maintain the fence. The owners of such animals are responsible for any damages or loss which may accrue to the corporation from the animals being upon its railroad track as a result of the nonconstruction of such fence, unless it is shown that the
loss or damage occurred through the negligence or fault of the corporation, its officers, agents, or employees.