In the long run, it's not really a question of traditional millitary might.
We must assume that a relatively strong millitary power like Pakistan can beat down a millitia - in open battle, that is.
But these insurgencies work in other ways and have other aims than the traditional millitary one. To properly combat them you only need traditional millitary as a shield to the real counter-insurgency effort, which is (or should be) a policing effort.
To "win", you need to win the population. The forces of order, does this by providing not only "security" but also a "sense of security". You can only do this by removing and isolating the insurgency from the population and you do that by detecting and disclose the members of the insurgency from the poster boy, the fund raiser, the soldier to the leaders. That is a policing effort - much like how you deal with organised crime - a traditional army is not suited for this and the traditional soldiers are useless to this task.
On the other hand the traditional police is also not suited for the task, they will be overwhelmed by the millitary force of the millitant insurgency. What we need is a cross-bread between millitary and police, a force that inherrits the firm, sturdy, organisation of the millitary and from the police inherrits the complex properties that defines a good police force.
And in this lies the real bad news for Pakistan: To have an effective policeforce is so much more difficult than to breed and build a battleworthy army. An effective policeforce need not only be skilled, well equiped and well organised. It needs to be trustworthy, uncorruptible, at level with the population etc.
The enemy, the insurgency, has a simple game plan: By spreading insecurity (by acts of terror and violence) and attacking the body of the state (police, administration, infrastructure,schools ect) they undermine the legitimacy of the state in the eyes of the population; because what basic legetimacy does a state have when it cannot provide basic services, let alone security?