Mr. Trump, a Republican, defeated Hillary Clinton, his Democratic opponent, by 10,704 votes in the state, or less than a quarter of a percentage point, the Michigan Board of State Canvassers announced, nearly three weeks after the Nov. 8 election.