The vote is a stinging rebuke of GOP leadership that paves the way for challenges to Trump’s signature economic policy.