Taking the traction motor of CRH2 high-speed train as the research object, this paper proposes a diagnosis method based on random forest and XGBoost for the compound fault resulting from stator interturn short circuit and air gap eccentricity. First, the U-phase and V-phase currents are used as fault diagnosis signal and then the Savitzky–Golay filtering method is used for the noise deduction from the signal. Second, the wavelet packet decomposition is used to extract the composite fault features and then the high-dimensional features are optimized by the principal component analysis (PCA) method. Finally, the random forest and XGBoost are combined to detect composite faults. Using the experimental data of CRH2 semiphysical simulation platform, the diagnosis of different fault modes is completed, and the high diagnosis accuracy is achieved, which verifies the validity of this method.