I doubt you would notice much difference with the surgical style mask. Most pollution from gasoline cars is in the form of various gases, which won't be filtered out. The only thing that a mask like that would stop would be fairly large particulate pollution (mostly produced by diesel engines, although that's dropped a lot with modern diesels), dust, and of course many bacteria carried on saliva and such. There really isn't much you can do to filter gaseous tailpipe emissions, and as the previous reply stated, changing your route would be the only way to help. Even changing it a little such as riding the next street over if it has less traffic will make a big difference though, as the concentration of pollutants drops rapidly as you get away from the cars.
This has been used as an argument against biking but, as has been mentioned, car drivers breathe in the same pollution, especially when stuck in gridlock. Even though many modern cars come with HEPA (high efficiency particulate air) filters, those still only filter out particles and not gases.