The development of predictive models for corrosion inhibition efficiency is essential to accelerate the discovery of effective and environmentally friendly inhibitors. In this study, a machine learning (ML)-based framework was established to predict the inhibition efficiency (IE%) of a diverse set of surfactants in corrosive environments. A total of 59 surfactants, representing a broad range of structural and physicochemical properties, were evaluated via weight loss experiments on A36 steel in both 0.5 M HCl and 3.5% NaCl solutions. Two concentrations were tested for each medium to capture concentration-dependent behavior, resulting in a comprehensive dataset of IE% values. Model input features included surfactant class, molecular descriptors (e.g., functional groups, hydrophilic–lipophilic balance, molecular weight), concentration, and pH. Several regression algorithms were applied, and the best-performing models achieved high prediction accuracy, successfully capturing nonlinear relationships between structure and performance. Additionally, the adsorption characteristics and inhibition mechanisms of the tested surfactants were examined in both acidic and saline media to provide mechanistic insights. These findings were used to support and validate the ML model’s predictions. This work highlights a novel, data-driven strategy for corrosion inhibitor screening and underscores the potential of integrating experimental and computational methods to guide sustainable corrosion protection in aggressive environments.