The rebels’ advance into other areas was slowed by a weakened military that recovered some villages from them.