According to the survey carried out by the Ministry of Environment, Forest, and Climate Change, approximately 190 elephants were killed after being hit by trains across India over the past two decades. A report from Indian Express also stated that trains ran over a large number of cattle between April 2019 and March 2020. Between 2020 and 2021, 27000 cattle deaths occurred as a result of trains running below capacity. Several reports claim that cattle deaths have been an obstacle for numerous train trips. To reduce the deaths of animals, this study introduces a railway line tracking system. The objective of this research work is to ensure the safety of wildlife from being a victim of train collisionwith a mechanism that involves the detection of object movement. The object movement is sensed by using ultrasonic sensors, and proximity sensors. The ultrasonic sensor monitors the presence of the objects and informs the centralized system, loco-pilot of the incoming train, and activates the buzzer. Consequently, it prevents accidents and saves animals' lives When the trains are around 5km away from the area of the accident, the system is activated. Otherwise, they remain idle.