Train collisions are among the most devastating transportation accidents, often resulting in significant casualties, infrastructure damage, and financial losses. Existing railway safety systems primarily rely on traditional signaling mechanisms, human oversight, and GPS-based monitoring, all of which have inherent limitations such as signal failures, latency in response time, and dependency on human intervention. In this paper, we propose a Wireless Sensor Network (WSN)-based identification system for train collision avoidance, which aims to enhance railway safety by utilizing an interconnected network of wireless sensors. These sensors, strategically placed along railway tracks and on trains, continuously monitor train positions, speeds, and track conditions. The gathered data is transmitted to a centralized control unit, which employs real-time processing algorithms to predict possible collisions and trigger preventive actions such as emergency braking or automated train speed adjustments. This system ensures timely detection of potential hazards, thereby significantly reducing the risk of train collisions. The proposed approach integrates Internet of Things (IoT) technologies, machine learning algorithms for predictive analytics, and low-power wireless communication technologies such as Zigbee and LoRa to facilitate seamless communication between trains and control stations. Our system improves upon existing railway safety solutions by providing real-time, automated, and cost-effective train collision avoidance mechanisms, making railway transport more reliable and efficient.