Mountainous freeways pose a higher risk for truck accidents due to their complex terrain, variable weather conditions, and constrained road infrastructure. To investigate the factors influencing the severity of truck accidents on mountainous highways and provide a scientific basis for proactive accident prevention and precise traffic safety management, this study employs machine learning methods to construct and analyze classification models for predicting accident severity. A total of 34 features, including collision type, vehicle type, pavement structure, horizontal alignment, vertical alignment, roadside protection measures, road surface conditions, season, and accident time, were selected as input variables. Accident severity, categorized into minor injury and severe injury, was used as the binary output variable. Three machine learning models were developed: Decision Tree (DT), Random Forest (RF), and Support Vector Machine (SVM). To evaluate the classification performance of these models, accuracy, precision, recall, and F1-score were used as assessment metrics. Furthermore, to gain deeper insights into the decision-making mechanisms of each model and identify key influencing factors, the study applied the SHapley Additive exPlanations (SHAP) method to interpret the model predictions and quantify the contribution of each input variable to accident severity. The results indicate that the RF model outperforms the DT and SVM models, demonstrating superior performance in terms of accuracy, precision, recall, and F1-score. SHAP analysis further identifies critical factors influencing the severity of truck accidents on mountainous highways, including rollover, absence of gradient, cement pavement, curves, frontal collisions, accident time (19:00—06:59), and lack of roadside protective measures.