The rapid increase of train speed has brought greater challenges to the safety and reliability of railway systems. Therefore, it is necessary to monitor the operation status of trains, infrastructure, and their operating environment in real time. Because the operation environment of railway systems is complex, the construction cost of wired monitoring systems is high, and it is difficult to achieve full coverage in the operation area of harsh environments, so wireless sensor networks are suitable for the status monitoring of railway systems. Energy resources of nodes are the basis of ensuring the lifecycle of wireless sensor networks, but severely restrict the sustainability of wireless sensor networks. A construction method of special wireless sensor networks for railway status monitoring, and an optimal energy resources allocation method of wireless sensor networks for intelligent railway systems are proposed in this paper. Through cluster head selection and rotating probability model, clustering generation and optimization model, and partial coverage model, the energy consumption of nodes can be minimized and balanced. The result of simulation experiment proved that the lifetime of wireless sensor networks can be maximized by the optimal energy resources allocation method based on clustering optimization and partial coverage model, based on polynomial time algorithm.