The commission may require every railroad corporation operating any steam or electric railroad in this State to erect and maintain lawful fences on each or either side of the railroad where the railroad runs through or upon lands of the United States or of this State, at such places as the commission determines that such fences are necessary to protect cattle, horses, or mules, or any other domestic animal being ranged or grazed upon lands adjacent to the railroad from being maimed or killed by the operation or management of engines, cars, or other rolling stock upon or over the railroad, with necessary openings and gates in the fences, and crossings and cattle guards for
such openings and gates.