This study investigates the influence of Dissolved Organic Carbon (DOC) on the bioavailability and ecological risk of six heavy metals (Cd, Cr, Cu, Ni, Pb, Zn) in the Upper Meghna River, Bangladesh. A total of 23 sites were sampled during dry and monsoon seasons to assess metal concentrations, DOC levels, and hydrochemical conditions. Results show substantial spatial variability in metal bioavailability, with exceptionally high exchangeable fractions of Ni (up to 80.95%) and Pb (up to 23.27%) near industrial discharge zones, and localized hotspots of Cd (12.36%) and Zn (22.99%) in agricultural and wastewater-influenced areas. t-SNE and PCA analyses identified eight distinct chemical states driven largely by DOC gradients, with high-DOC clusters showing elevated mobilization of Cd and Cu, while low-DOC, high-salinity zones exhibited increased free metal fractions. Ecological risk assessment revealed that although 5–18% of the river showed moderate contamination, probabilistic estimates indicated much broader vulnerability, with P(RQ > 1) reaching 73% for Cu, 67% for Pb, and over 20% for Cd and Ni. Species Sensitivity Distribution (SSD) results further showed high toxicity potential, particularly for Cu and Cd. Machine learning models—especially Random Forest and XGBoost (AUC > 0.95)—accurately predicted bioavailable metals, while Physics-Informed Neural Networks (PINN) effectively captured mobilization dynamics with strong convergence (loss ∼ 10⁻3). The findings demonstrate that DOC dynamics and anthropogenic inputs jointly control metal mobility and ecological risk in the river. The study recommends bioavailability-based monitoring, DOC-inclusive water quality standards, and targeted management in industrial and DOC-rich zones to mitigate ecological impacts.