The safety and reliability of undivided two-way highway–rail grade crossings (HRGCs) are of paramount importance in transportation systems. Utilizing crash data from the Federal Railroad Administration between 2020 and 2021, this study aims to predict crash injury severity outcomes and investigate various factors influencing injury severities. The χ2 test was first used to select variables that were significantly associated with injury outcomes. By employing the eXtreme Gradient Boosting (XGBoost) model and interpretable SHapley Additive exPlanations (SHAP), a cross-category safety assessment that offers an evidence-based hierarchy and statistical inference of risk factors associated with crashes, crossings, vehicles, drivers, and environment was provided for killed, injured, and uninjured outcomes. Some significant predictors overlapped between the killed and injured models, such as old driver, driver was in vehicle, main track, went around the gate, adverse crossing surface, and truck, while the other different significant factors revealed that the model could distinguish between different severity levels. Additionally, the results suggested that the model has varying performances in predicting different injury severities, with the killed model having the highest accuracy of 93.36%. The SHAP dependency plots for the top three features also ensure reliable predictions and inform potential interventions aimed at strengthening traffic safety and risk management practices, such as enhanced warning systems and targeted educational campaigns for older drivers.