Mr. Cox, who wrote on Twitter during the Capitol riot that Mike Pence was a “traitor,” defeated Kelly Schulz, who had been backed by the state’s popular governor, Larry Hogan. The Democratic primary was too close to call.