The ceasefire with the Syrian Democratic Forces, a U.S. ally against the Islamic State, came after the group lost much of its territory in a weekend of clashes.