Heavy metal-contaminated soil has a great impact on yield reduction of vegetable crops and soil microbial community destruction. Biochar-derived waste biomass is one of the most commonly applied soil conditioners in heavy metal-contaminated soil. Different heavy metal-contaminated soil added with suitable biochars represent an intriguing way of the safe production of crops. This study investigated the effects of two types of biochar [rice husk biochar (RHB) and sugarcane bagasse biochar (SBB)] on Cd and Pb accumulation in Shanghaiqing (SHQ, a variety of Brassica campestris L.) and Fengyou 737 (FY, a variety of Brassica napus), as well as on the soil microbial community, through a field experiment. RHB and SBB were characterized by scanning electron microscopy, Fourier transform infrared spectroscopy, and Brunauer-Emmet-Teller method. The results showed that RHB and SBB displayed the higher pH, cation exchange capacity and pore properties, and the addition of RHB and SBB enhanced soil pH and rhizosphere microorganisms promoting vegetables yield. RHB treatments were more effective than SBB in reducing upward transfer of Cd and Pb, blocking the accumulation of Cd and Pb in the edible parts of SHQ and FY, and decreasing soil Cd and Pb bioavailability. Additionally, RHB and SBB changed the composition of the rhizosphere soil microbial community. The application of biochar promoted the growth of ecologically beneficial bacteria (Nitrospira, Opitutus, and Gemmatimonas) and fungi (Mortierella and Holtermanniella), whereas reducing the enrichment of plant pathogenic fungi (Alternaria, Stagonosporopsis, Lectera, and Periconia) in rhizosphere soil. Our findings demonstrated that the application of RHB significantly reduces Cd and Pb accumulation in the edible parts by decreasing the soil Cd and Pb bioavailability and altering the rhizosphere microbial community composition in two Brassica vegetables grown on Cd/Pb-contaminated soils. Thus, the application of two biochar, especially RHB is a feasible strategy for the safe production of vegetable crops in Cd/Pb co-contaminated soils.