Time will tell.. If the Taliban fall back into their old habits of pre-9-11 of giving safe haven and training grounds to terrorist groups like AQ, ISIS, others, then you'll know..If not, then those republican congress critters were wrong.
It's possible that driving the Taliban and AQ operatives along with others into the mountains on the Pakistani border did prevent further terrorist attacks. There's no way of knowing for sure one way or the other. Hence it becomes political talking points, what if's if you will. If we hadn't stayed for 20 years more terrorist attacks would have occurred of if we hadn't gone in, no more terrorist attacks would have happened.
Like in most instances, the truth is probably somewhere in-between those points of view. How far to one or the other side, who knows? We only know that life will never be the same as it was pre-9-11.
Perhaps 20 years out of power, the Taliban may have learned the lesson of not sheltering terrorist group. Then again, maybe not. Only time will provide the answers. All we can do is speculate.