In most cases, conventional energy dispersive X-ray fluorescence (EDXRF) analysis of trace arsenic (As) and lead (Pb) in grains encounters technical difficulties due to sensitivity challenges and the overlapping of characteristic X-ray lines. By utilizing high-definition X-ray technology and doubly curved crystal (DCC), along with establishing interference correction models for As and Pb, we can significantly improve analytical sensitivity for specific portions of the spectrum while reducing interference. This study demonstrates that the improved monochromatic excitation energy dispersive X-ray fluorescence spectrometry (MEDXRF), combined with an algorithmic analysis of fundamental parameters (FP), exhibits higher sensitivity compared to existing EDXRF methods. This improvement is achieved by optimizing the DCC structure, device geometry layout, and detection conditions. The detection limits, precision, and accuracy of MEDXRF for As and Pb were evaluated using certified reference materials (CRMs) and actual grain samples. The test results indicate that the limits of detection (LODs) were generally better than those specified by the Codex general standard, with values of 0.02 mg/kg for As and 0.03 mg/kg for Pb. The accuracy and precision were in good agreement with ICP-MS results. Therefore, the enhanced MEDXRF method offers sufficient sensitivity, accuracy and stability for the direct determination of As and Pb in grains below food safety limits.