The Taliban said in a statement that its “jihadi resistance forced another arrogant power of the world, the United States, to fail and retreat from our holy territory of Afghanistan.”But anger against the group was rising, and governing was proving perilous.