Despite their significance in understanding soil ecology and health, there is a scarcity of studies on soil modelling in urbanized landscapes. In this study, we evaluated the performance of machine learning (ML) and hybrid techniques in predicting topsoil pH (0–20 cm) in the city of St. Petersburg (Russia). We used a dataset of 84 soil pH measurements and environmental covariates, including remote sensing data, relief and anthropogenic maps. We applied Random Forest (RF) and RF plus Residual Kriging (RFRK) approaches for digital mapping of pH values. The predictive performance of the models was assessed using several metrics, mean absolute error (MAE), including root mean squared error (RMSE), coefficient of determination (R2) and Nash–Sutcliffe model efficiency coefficient (NSE). We also evaluated the prediction uncertainty with the prediction interval coverage probability (PICP) and “Area of applicability” (AOA) approach. Our results showed the pH levels varied between 4.4 and 8.6 and were characterized by moderate spatial dependence. Both models demonstrated similar performance, whereas the RFRK model slightly outperformed the RF approach with prediction performance MAE = 0.50, RMSE = 0.58, R2 = 0.63 and NSE = 0.47. The PICP suggested that the uncertainty associated with pH was underestimated, whereas almost all predicted areas were within the AOA. We found that remote sensing covariates (vegetation indices) were the most important predictors of soil pH. According to the generated maps, alkaline soils were mostly located in urbanized areas with dense buildings, whereas low pH values were observed in parks and open relatively undisturbed areas. Our findings highlight the potential of remote sensing data for digital mapping of soil pH in urban environments, typically characterized by higher complexity and heterogeneity.