They both went downhill after a while, Metallica after Garage Days and Megadeth after Rust in Peace.
But while they were peaking, I'd pick Megadeth as having the superior technical musicianship overall, you can't compare Kirk Hammet to Marty Friedman, Marty blows him away, even Dave Pollack was better, drummer wise both are up there, bass is pretty much irrelavant.
Lyrically James was better on the first couple of albums but Dave destroyed him later. I mean, Enter Sandman is cheese any way you slice it. "Hush little baby, don't say a word and never mind that noise you heard."

Compare that to Peace Sells... or Hook In Mouth. (one of the best speed riffs ever)
Both had great riffs, but I like playing Megadeths stuff over Metallica's, just personal taste.
Hook In Mouth
A cockroach in the concrete, courthouse tan and beady eyes.
A slouch with fallen arches, purging truths into great lies.
A little man with a big eraser, changing history
Procedures that hes programmed to, all he hears and sees.
Altering the facts and figures, events and every issue.
Make a person disappear, and no one will ever miss you.
Rewrites every story, every poem that ever was.
Eliminates incompetence, and those who break the laws.
Follow the instructions of the new ways evil book of rules.
Replacing rights with wrongs, the files and records in the schools.
You say youve got the answers, well who asked you anyway?
Ever think maybe it was meant to be this way?
Dont try to fool us, we know the worst is yet to come.
I believe my kingdom will come.
Chorus
F is for fighting, R is for red,
Ancestors blood in battles theyve shed.
E, we elect them, E, we eject them,
In the land of the free, and the home of the brave.
D, for your dying, O, your overture,
M, they will cover your grave with manure.
This spells out freedom, it means nothing to me,
As long as theres a p.m.r.c.
Put your hand right up my shirt,
Pull the strings that make me work,
Jaws will part, words fall out,
Like a fish with hook in mouth