Good observation! I have thought the same.
I think there are a couple of things going on here. First of all, Mycroft tried to intimidate John from the get-go with that elaborate use of spy cameras, mysteriously ringing phones and the empty warehouse. John doesn't respond well to intimidation, and from the start has been happy to put Mycroft in his place whenever he can.
Secondly, John is entirely loyal to Sherlock. He can see that Mycroft tries to push his brother around, and as friends should be, he sticks up for Sherlock. I love especially that grin on John's face (in TGG I think?) when Sherlock practically chases Mycroft on his way out of the flat with a shrill scraping of his violin.
Having said that, Mycroft depends on John to look after his unstable, brilliant little brother, and John accepts that responsibility. In that, they respond to each other as allies. We see that twice in ASIB, first when Mycroft calls John to keep an eye on Sherlock as it may be 'a danger night', and later when Mycroft gives John the job of telling Sherlock that Irene is dead.