Real-time status monitoring is crucial in ensuring the safety of railway tunnel traffic. The primary monitoring method currently involves deploying sensors to form a Wireless Sensor Network (WSN). Due to the linear characteristics of railway tunnels, the resulting sensor networks usually have a linear topology known as a thick Linear Wireless Sensor Network (LWSN). In practice, sensors are deployed randomly within the area, and to balance the energy consumption among nodes and extend the network's lifespan, this paper proposes a self-organizing network and routing method based on thick LWSNs. This method can discover the topology, form the network from randomly deployed sensor nodes, establish adjacency relationships, and automatically form clusters using a timing mechanism. In the routing, considering the cluster heads' load, residual energy, and the distance to the sink node, the optimal next-hop cluster head is selected to minimize energy disparity among nodes. Simulation experiments demonstrate that this method has significant advantages in balancing network energy and extending network lifespan for LWSNs.