A railroad company, which erects at a farm crossing a gate for the exclusive use of the owner and occupants of that farm, provides a lock for the gate, and delivers the key for the lock to the owner or occupant, is not liable to the owner or occupant for an animal killed or injured because the gate was left open without fault of the company, unless the killing or injury resulted from the wanton or malicious act of the company or its employees.