Now let's put you into the real world. If the United States military attacked Canada, the conflict would go on for decades. I am NOT Canadian. I am a pro-USA Trump voter, who lives in the real world and spent 23 years of my life in the military.
Think back: The year was 2001 and the United States invaded Afghanistan. Twenty years later (2021) the USA left Afghanistan without winning against the Taliban.
The almighty Taliban military force: Non-professionally trained men. Their armament: AK-47's, AK-74's, RPK Machine Guns, Rocket-Propelled Grenade Launchers, 82 Millimeter Mortar Systems, some old bolt-action rifles and Improvised Explosive Devices. Their successful tactic: Guerilla Warfare. It takes years, but in the long term it wears down a more powerful military force, financially and its enemy's citizens from the ongoing losses.
If you want another example: Vietnam. North Vietnam had a standing military that was inferior to the United States in every way, but it also had an effective guerilla force. The Viet Cong. Between those two forces, they killed 10's of thousands of U.S. military personnel and in the end, we pulled out.
Guerilla warfare is a highly effective tool of an enemy, especially if they thoroughly know the territory they are fighting in.
I think you may need to study the history and art or warfare a bit more, since you have presented a bushel of misconceptions and partial ignorance here. Where to begin .... ???
"Their armament: AK-47's, AK-74's, RPK Machine Guns, Rocket-Propelled Grenade Launchers, 82 Millimeter Mortar Systems, some old bolt-action rifles and Improvised Explosive Devices."
None of this can be made while hiding out in the mountains of the Pushtan (or any wilderness). These all require a high degree of precision manufacturing for both the weapons and the ammunition. It starts with assorted mining operations, than ore processing, smeltering, stock manufacturing, then machining and assembly, etc. This all will require an immense infrastructure of roads, transportation, electrical power generation and distribution grid, etc. The Taliban
* did not have the knowledge, skill, and especially the resources and economic and industry foundation and infrastructure to do all this.
As with any modern (gunpowder onward) method of warfare, the backing of a developed nation(s) is needed to provide these weapons and equipment, and then get them into the hands of the Taliban, or '
*' any other modern guerilla force. And in the case of the Taliban, they were trained, by the USA and Allies, during the 1980s to fight the USSR/Russia. BTW, that's also how they got this stock pile of weapons, ammo, equipment and other supplies, etc. Read the book "Charlie Wilson's War" to get the basic scope and gauge on all of this. Note also that all this flow of weapons and training was in Western Pakistan before going into Afghanistan to fight the Soviets.
When the Soviets left, so did USA(CIA) interest, but the Islamic Fundamentalists factions of the Paki military and ISI were willing to fill that void, starting with the rebranding known as the Taliban. Bottom-line is that for the USA/West to defeat the Taliban, one has to first defeat their support base within the Pakistan military and ISI. Which would at least start a possible civil war within Pakistan and lead to a larger mess and likely one less controllable, among other things.
Guerilla warfare to be successful will need an outside support and source of weapons, ammo, equipment and supplies, training(advisors), etc.; all this being ideally in neighboring nations on the border. Also the possible limitations on the opposition to the guerilla's, having some form of restraint on full out unconditional countermeasures including willingness to carry the battle into those neighboring nations serving as conduits supporting the "guerillas".
In the case of SE Asia/Vietnam, the Viet Cong had essentially ceased to exist by the mid-late 1960's, which is why the war in South Vietnam became one against North Vietnamese military units that infiltrated South and applied "guerilla tactics" as much as possible. However, once again most of the weapons and supplies were imported into SE Asia from outside, specifically from PRC-China and USSR-Russia. The USA failed to have the will and resolve to effectively bombard and interdict the flow of weapons, supplies, and aid into N. Vietnam and on down to the South. The USA had the power to do so, but that would entail a level of escalation in application and targeting that risked bring China and/or Russia overtly into the war, not only in the SE Asia region but also quite likely in other parts of the world.
So it boils down to this;
"Guerilla Warfare" requires outside area/region support in form of manufactured weapons, ammo, equipment, supplies (including often food and medical), as well as training, and often safe bases out of the combat zone for R&R, training and equipping, etc. You aren't going to craft a hard steel rifled barrel or the brass casing, primer, propellant and spec bullet to fire through it over a campfire.
Guerilla warfare could take years to win, but it will depend on that outside source and flow of weapons, supplies and other aid, but also a certain level of support and "comfort" from the indigenous/native population. Also it will often depend upon an opposing "anti-guerilla" force/opponent that is constrained in the level and nature of force it can use, where and when it can use it (such as not going into sanctuary bases in the neighboring "non-combatant" nations), and in the patience and endurance of the opponent for what could be a long term campaign. Much will also depend upon the willingness of the counter-insurgency to be as brutal as need to defeat the guerillas and their supporters.
All the above is mostly the 20th century to early 21st century factors. Increases in aerial and orbital surveillance and attack abilities, along with AI, and also increasing efficiency of radio and telemetry will shift the benefit and odds more towards the counter-insurgency side than the guerilla side.