Check out turns 10 and 11 of this replay...
https://play.pokemonshowdown.com/battle-gen7ou-783166174
If both pokemon have a speed tie, then the pokemon who attacks first is chosen randomly and then the alternate pokemon gets to hit first right? If Mega Aerodactyl and Mega Alakazam have a speed tie, then the first pokemon to attack is chosen randomly in the first turn and then in the next turn, the alternate pokemon gets to attack first right? That's how a speed tie is decided correct?
If both Mega Alakazam and Mega Aerodactyl have a speed tie, then how did Mega Alakazam attack first twice in turns 10 and 11?
Please clear my doubts and also please tell me are any special preferences or advantages provided to pokemon during battle who are of OU in the OU tier battles over UU or any other tier?
I would really appreciate it if my doubts are cleared.
Speed ties determine randomly each turn who acts first - there's no set order at all. Much like a coin can land on heads twice in a row a Pokemon can win a speed tie multiple turns in a row.