Most insurgencies are not ended through military means alone. When we evaluate the effectiveness of the Afghan National Security Forces (ANSF) in conducting coutnerinsurgency - it is unlikely that the Taliban will be defeated. Sure . . . the ANSF can "overmatch" the Taliban on the battlefield when supported by fires and air support ("overmatch" is a favorite phrase of the U.S. military to lead you to believe the ANSF are winning). However, the ANSF can't do effective COIN and are unlikely to defeat the Taliban.
One of two things need to occur to end an insurgency; and many times, both. The first is the root causes of the insurgency need to be identified and addressed and the second is that negotiations with the insurgents need to take place. Afghanistan, being one of the poorest and most corrupt nations in the world, is a long way from being able to provide essential governmental services and good government - therefore it probably can't address the root causes in the near future. The track record for negotiations with insurgents thus far has not been good. Additionally, because the insurgents enjoy the protection of Pakistan, the key to negotiations with the insurgents is Pakistan.
One observer of the South Asian region explains the relationship between Pakistan and Afghanistan; and further, how India and China are involved and what these two nations can do to aid the negotiation process. Read "Afghanistan should not make a false choice - analysis", Eurasia Review, December 18, 2014.