I agree that Mega Gengar's Shadow Tag is extremely useful, but I feel like Mega Alakazam is better, but there's a caveat - it's insanely powerful with paired with Tapu Lele or any other Pokemon with Psychic Terrain. Terrain boosted Psychic is one of the strongest moves capable of OHKOing any neutral, non bulky Pokemon. Not only that, Psychic Terrain renders priority moves (one of the banes of M-Alakazam) completely useless. Further, M-Alakazam also has access to Recover, which Gengar lacks.
And Trace is great in some situations, tracing an opposing Swampert's Swift Swim in Rain will definitely give you a bigger advantage than having a Mega Gengar in that case.
However Mega Gengar has plenty of viable sets, from all out attacker to Perish Trapper to more gimmicky sets with Taunt + Disable, making it better against Eviolite Chansey.
So if you have Terrain support, Mega Alakazam really shines, but if not, Mega Gengar can certainly help you get rid of certain threats your team has trouble against.