Maintenance management of stationary combustion engines in the agricultural sector faces critical challenges owing to a reliance on manual methods, which increases the risk of unplanned downtime. This study developed a machine learning-based predictive model to anticipate failures within a 60-day horizon, facilitating the transition from a reactive to a proactive maintenance approach. Following the CRISP-DM methodology and drawing on a historical dataset of 2,250 records from 59 engines, feature engineering techniques were applied to derive 48 predictor variables, while K-Means clustering was employed to identify operational load profiles. The performance of two ensemble algorithms was then evaluated; LightGBM outperformed Random Forest under five-fold cross-validation with a 60/40 temporal split. The proposed model achieved an area under the ROC curve (AUC) of 0.91, a precision of 92.9%, and a recall of 76.1% for detecting actual failures. The findings indicate that gradient boosting techniques are highly effective for optimizing maintenance planning and reducing operating costs in the Ecuadorian agricultural context.