Rare rebuke of Trump’s mass deportation agenda, enabled by small group of Republican defectors, to last three years