I know this is a pretty old thread, but it was an early result when I was googling for Prankster + After You (seeing if that combo existed). This looks like gen 6 Pokemon, in which case Showdown is handling this interaction properly. In Gen 6 (XY and ORAS), turn order is calculated before megaevolution happens, meaning it takes into account abilities from before mega evolving. It also uses the base form speed, which was incredibly relevant in various competitive formats (for example Kangaskhan has base 90 speed, but Mega Kangaskhan has base 100 speed. In VGC 2016, this meant that Kangaskhan would speed tie primal Kyogre/Groudon on turn 1 (also base 90 speed), but outspeed them on future turns after it has mega evolved).
TL;DR, this isn't an issue with showdown. The correct answer is this is how turn order works with mega evolution in gen 6.