A federal judge in Maine ruled Thursday in favor of the state’s ranked-choice election system and against Republican U.S. Rep. Bruce Poliquin, who challenged the voting process after losing a close race last month.

Maine’s secretary of state declared Democratic challenger Jared Golden the winner by a slim margin on Nov. 15 after the ranked-choice tabulation process. A recount is ongoing at Mr. Poliquin’s request.

In...