You’d never guess how this one may have come about. At one time, Alabama was an open range state, so livestock roamed freely. Anyone or entity that caused harm to the livestock was responsible for the market value of that animal. This includes the railroad company being responsible for cattle that were hit by trains.
A common scam in those days was for farmers to lure sick or injured animals (via a salt lick) to the train tracks. When the animal was hit by a train, there was no longer any evidence that it was sick or injured, so the railroad company would be liable for the full market value of a healthy animal!
Since there was no way to prove that this was the case after the fact, this law was passed so in order to outlaw the farmer creating the circumstance for the “loss” of their animals.
There is an old saying that “Nothing increases the pedigree of a cow more than an encounter with a train” !!