Type 2 diabetes mellitus is a metabolic disorder that requires an early detection system to support accurate diagnosis identification. One of the major challenges in developing classification models based on clinical medical records is class imbalance, which may cause models to be biased toward the majority class, particularly in multiclass classification involving the Prediabetes class, which represents only 5.3% of the total data. Failure to accurately identify the Prediabetes class may have serious clinical consequences, as this stage still provides an opportunity for early intervention to prevent progression to Diabetes. This study compares the performance of Extreme Gradient Boosting (XGBoost) and Random Forest for multiclass diabetes classification (Normal, Prediabetes, and Diabetes) using clinical data obtained from Medical City Hospital and Al-Kindy Teaching Hospital, Iraq. A Split-First, Resample-Later procedure was employed to prevent data leakage, while Synthetic Minority Over-sampling Technique (SMOTE) was applied to balance the training data, and Grid Search was used for hyperparameter optimization across different train-test split ratios (60:40, 70:30, 80:20, and 90:10). This study provides a comprehensive evaluation of XGBoost and Random Forest on imbalanced multiclass clinical data by comparing their performance before and after SMOTE application across different train–test split ratios using the Split-First, Resample-Later procedure to prevent information leakage between the training and test set. The experimental results demonstrate that Random Forest achieved more stable performance than XGBoost across all evaluation scenarios, both before and after SMOTE application. Both models achieved their best performance with an 80:20 train–test split ratio, whereas SMOTE significantly improved the performance of XGBoost only under the 60:40 split ratio. Furthermore, feature importance analysis identified HbA1c, BMI, and AGE as the most influential clinical attributes for diabetes classification.