The balance between budgeting and retaining the optimum performance of railway infrastructure has gained significant importance. Due to the expansion of railway networks, high maintenance costs, and limited budgets, prioritizing maintenance operations takes time and effort. On the other hand, derailments are one of the most essential types of rail accidents worldwide. Derailments are usually caused by railway track defects, machinery, or human error. According to the high importance of railway track effect on derailment accidents, the financial consequences of derailment accidents caused by track defections in Iranian’s railway network are analyzed in this paper. In this regard, an original data frame of 9750 accidents with 181 features for each related accident is used. The most important track-relevant attributes affecting accidents’ consequences are selected using various feature ranking methods, namely Recursive Feature Elimination (RFE), Mutual Information (MI), and Classification and Regression Trees (CART). The top features are speed limit, track age, maximum upgrade, and steep index. Then different types of regression Machine Learning (ML) models were implemented. The extra trees model was selected for its proper efficiency based on the Normalized Root Mean Square Error (NRMSE) metric to estimate the financial consequences of rail derailment accidents. The presented model can estimate the financial consequences of derailment accidents caused by track defects with an NRMSE of 18.2%. The results of the proposed model can be used for prioritizing maintenance works and budget allocation by ranking railway blocks based on their potential accident consequences.