In this work, the position-dependent mass Schrödinger equation is solved with the Pöschl-Teller-like potential in the presence of magnetic and Aharonov–Bohm (AB) flux fields. The BenDaniel-Duke ambiguity parameter ordering is used to formulate the Hamiltonian operator for the system. An approximate analytical equation of the bound-state energy spectrum is obtained using the parametric Nikiforov-Uvarov solution technique along with a Pekeris-like approximation scheme. With the aid of the obtained equation for the energy levels, analytical formulas of magnetization and magnetic susceptibility at zero-temperature are derived and subsequently used to predict the physical properties of diatomic substances including the ground state H2, HCl, CO and LiH molecules. The expression for the bound-state-energy spectrum is used to generate numerical data for the molecules. The computed energy eigenvalues agree with the literature on diatomic molecules. The study revealed that in the absence of the external fields, the energy eigenvalues and magnetic susceptibility of the system are degenerate. However, with only a low intensity AB field, the degeneracy is completely eliminated from the energy states of the molecules.