Due to the urgent demand for lightweight and high-strength materials in rail transportation, this study proposed foamed polylactic acid (PLA) composites reinforced with continuous basalt fibers (BF) using 3D printing technique to address the limitations posed by foaming-induced strength reduction in foam. Through a combination of parametric calculations, microscopic observations, and compression experiments, the effects of printing parameters on the expansion ratio and print accuracy of foamed composite were investigated. It was found that adding fibers to foamed PLA reduced the expansion ratio of PLA by up to 9.52% at lower printing temperatures and layer heights but increased it at higher settings. The expansion ratio of the composite significantly increased with high printing temperatures and layer heights. When the composites were fabricated at low print temperatures and high layer heights, noticeable interlayer gaps and exposed fibers leading to poor impregnation were observed at cross section. This phenomenon was improved as the expansion ratio increased. In addition, specimens with optimal print accuracy were prepared at specific combinations of printing temperature and layer height. In light of this discovery, a predictive function based on combined printing parameters was established to design composites with excellent print accuracy and specific densities. Finally, compression test results showed that with the same density of 0.5 g/cm3, the foamed composite exhibited substantial improvements in compressive strength, modulus, and strain energy density compared to the foamed PLA, with increases of 44.44%, 57.02%, and 24.19%, respectively.