A surgical mask's going to be ineffective. They're designed to contain aerosolised droplets from the wearer (and provide a useful degree of splatter protection), not filter the air that you breathe.
In my limited experience of dust masks, the ones with a bypass valve for releasing exhaled air are significantly better at not steaming up glasses. I suspect the answer is the proper ones that fit snugly as Jurek suggests.