I have a feeling Mega Evolutions take ultra-priority in a turn, then, whatever stat changes happen in speed, redetermines the turn order.
Looking it up, Mewtwo and Crobat (who is the first Pokemon sent out in the demo) have the same base speed. If you chose not to Mega Evolve, Crobat probably would have gone first due to probably having a speed-boosting nature.
Just a guess.
3DS FC: 2578-3118-6645 PSN: PowahBoxers I need to play Paper Mario: The Thousand Year Door again...