The dynamic response at high speed affects both the vehicles and the structures in a complex manner, especially in the railway infrastructure problems. In this study, we developed a new KD-Railway tool for analyzing the dynamic behavior of high-speed railways by using the finite element method. Then, extreme gradient boosting (XGBoost) was used to predict and better understand the dynamic response of high-speed railway bridges. The model was trained and tested using a dataset including properties and dynamic responses of 10,000 bridges generated by KD-Railway. The input variables were the bridge span length, the flexural rigidity, mass per length of the bridge, the cross-section area of bridge decks, the train speed, the damping ratio, and the HSLM train models. On the other hand, maximum vertical deflection and maximum acceleration were considered as the output parameters. The coefficients of determination (R2) for these two outputs were (0.996, 0.931, 0.977) and (0.987, 0.901, 0.962) for the training, testing, and entire dataset, respectively. The sensitivity analyses were also conducted to evaluate the importance of each input variable on the outcomes.