A responsive government, conscious of the needs of the people, could defeat Pakistan in this. Many factors disturb the situation. Pakistan's media pours out fundamentalist propaganda designed to hit Indian secularism. The point is often made that the people must be prepared to sacrifice their lives to uphold Islam. Osama bin Laden's cry for jihad against India gets into this fundamentalist mind-set.
Pakistani propaganda keeps religious beliefs at a violent high point.
To an extent India can beat this off by showing up the high points of a secular way of life. The campaign against Christians in India shatters the minorities' belief in Indian secularism. The madrasas run by fundamentalists should be properly controlled without curbing religious freedom. It has so far not been possible for the Indian forces to control foreign infiltration. The usual explanation is that the terrain comes in preventing infiltration.