Broken rails are a primary factor considered in railroad capital planning investments. This paper develops a spatial-temporal neural network model based on ResNet-Transformer architecture to predict the occurrence of broken rails one year in advance. The railroad data for this research includes infrastructure data, operational data, condition-related data, and maintenance activities. First, this research captures detailed spatial correlations and temporal dependencies, ensuring that each aspect is considered for its specific impact on rail integrity. Then, utilizing the ResNet architecture, the proposed model captures spatial correlations among static rail characteristics. Subsequently, the Transformer architecture is utilized for effectively handling long-term temporal data patterns and dependencies that reflect dynamic changes over time. An experiment was conducted based on railroad data collected from one major freight railroad covering about 20,000 miles of track spanning seven years, from 2013 to 2021. AUC values of the proposed model for the training, validation, and test set are 0.84, 0.81, and 0.81, respectively, demonstrating that the model has a relatively good performance and generalizes reasonably well to the validation and test set. The results indicate that the proposed model outperforms traditional machine learning approaches such as XGBoost, especially in identifying high-risk segments. When screening 10% of the highest-risk rail segments, the model can capture 41.6% of broken rails, compared to only 33.1% detected by XGBoost and 38.0% detected by ResNet-only model. This enhanced detection capability highlights the model's effectiveness in utilizing complex pattern recognition across both spatial and temporal data. The proposed spatial-temporal model not only aids in proactive maintenance to improve the safety and reliability of rail transportation but also contributes to more strategic capital planning in the railroad industry.