The battle for Ajrestan illustrates the grave challenges facing Afghanistan’s new president as foreign combat troops prepare to leave at the end of the year.