Mega Heracross outspeeds my mega alakazam with pin missle. How in the world did this happen? My mega alakazam has MAX Evs in speed. There has got to be an answer for this.
Other than these things, I think it was most likely a glitch. Even at 0 IVs in speed, 252 EVs would mean that Alakazam definitely outspeeds unboosted Heracross & Mega-Heracross.
Some things that could make it faster:
2:Mega Heracross might've had Choice Scarf...
5: A Pokemon might've lowered your speed from before
6:Possible Glitch (Pokemon games glitch too barely though)