The vote was 219 to 212, largely along party lines, in the House, where Mr. Trump’s fellow Republicans control a narrow majority of seats; two Republicans voted in favor of the resolution and four Democrats voted against it