Yaar Kabeer, a soldier's bravery is tested against another soldier's in a battlefield, not against a politician on home turf. As for taking on Nawaz Sharif, Musharraf wasn't the first army man taking on politicians in Pakistan, he had a precedent to back him.
And please do not compare apples and oranges. The situation in India is entirely different from that of Pakistan. In India, politicians may mismanage a lot of things, but the Army has a fair degree of freedom, but never does the Army poke its nose into the political affairs.