Fuck, that was a hard question to answer. I voted Megadeth.
I'm going to do something I saw on another site and break it down by decade.
80s: Megadeth. Metallica released the godly Kill Em' All and Master of Puppets during this era, IMO Ride the Lightning and And Justice For All were okay, but not masterpieces by any means.
90s: Metallica. The Black Album, Load, and ReLoad are masterpieces. Megadeth released three good albums and one awful album during this period, giving Metallica a decent edge over Megadeth.
2000s: Megadeth. The 2000s were practically devoid of Metallica releases. St. Anger is awesome, but Death Magnetic is mediocre at best. Megadeth simply released more albums in the 2000s, and they were all at least good, so Megadeth wins here.
2010s: Megadeth. Obviously. The case is pretty much the same as it was with the previous decade.
As a side statement, I prefer Exodus to both bands.