Whenever livestock appears on the tracks as an obstruction ahead of a railroad train, it shall be the duty of the engineer, or the person in charge of the operation of the train, to blow the alarm whistle and apply the brakes, in order to prevent, if reasonably possible, the striking of the livestock.