Soil organic matter (SOM) significantly impacts the detection accuracy of Cd2+ and Pb2+ using square wave anodic stripping voltammetry (SWASV) due to the complexation of SOM to heavy metal ions (HMIs), thereby attenuating SWASV signals. This study explored an effective pretreatment method that combined low-pressure ultraviolet (LPUV) photolysis with the ZnO/g-C3N4 photocatalyst, activating the photocatalyst to generate highly oxidative •OH radicals and O2•− radicals, which effectively disrupted this complexation, consequently restoring the electroactivity of HMIs and achieving high-fidelity SWASV signals. The parameters of the LPUV-ZnO/g-C3N4 photocatalytic system were meticulously optimized, including the pH of photolysis, duration of photolysis, g-C3N4 mass fraction, and concentration of the photocatalyst. Furthermore, the ZnO/g-C3N4 photocatalyst was thoroughly characterized, with an in-depth investigation on the synergistic interaction between ZnO and g-C3N4 and the mechanisms contributing to the restoration of SWASV signals. This synergistic interaction effectively separated charge carriers and reduced charge transfer resistance, enabling photogenerated electrons (e−) from the conduction band of g-C3N4 to be quickly transferred to the conduction band of ZnO, preventing the recombination of e− and hole (h+) and generating more radicals to disrupt complexation and restore the SWASV signals. Finally, the analysis of HMIs in real soil extracts using the proposed pretreatment method demonstrated high detection accuracy of 94.9% for Cd2+ and 99.8% for Pb2+, which validated the feasibility and effectiveness of the proposed method in environmental applications.