Rail weld defects are major threats to railroad transportation. Enormous resources have been required for related maintenance. This paper presents a creative solution to predict weld defects and to classify railroads into different conditions based on the predictions. The results are based on features extracted from manufacturing technologies of welds, from related materials and from influential factors in the environments. Features such as marks for welding engineers are defined. Maintenance can be selectively implemented based on the predicted conditions. Safety is the foundation of the railroad business, and a very strict safety requirement is utilized as one of the main constraints in this research. Additionally, 11 key risk factors leading to rail defects and their risk levels are identified. Extreme learning machine (ELM), random forest, logistic regression, principal component analysis (PCA), support vector machine (SVM) and other data science approaches are utilized. The evaluation results show that the related rail maintenance workload can decrease significantly under high safety standards. Labor costs of weld inspection will be reduced substantially because of the decreased workload for the sections predicted to not have any defects with a 100% recall rate (approximately 30% of the total sections), contributing to a massive cost reduction. Consequently, rail companies are expected to achieve enhanced management and operation.