In this article, a wide area measurement and control system (WAMC) in the railway network is prepared for online monitoring and centralized control of rail vehicles with the aim of creating a smart railway network. The provided wide area measurement and control system increases safety in the movement of rail vehicles. This system can be used to improve the performance of the railway traffic control electric signal system. This system performs three main tasks. First, it performs the task of monitoring the rail network and estimates the current speed and location of all rail vehicles, then identifies dangerous situations, and finally sends the necessary control commands to the control systems for safe movement. For this purpose, we first use the GPS system and Kalman filter to locate railway vehicles and monitor them online. Then, using an algorithm, we identify dangerous positions in the railway network, and finally, the control command is given to the control systems. Moreover, to address the problem of outliers among measurement data, an outlier detection criterion is presented, followed by designing a generalized maximum-likelihood unscented Kalman filter (GM-UKF).