The Wisconsin Supreme Court’s ruling dashed the hopes of Republican state lawmakers who sought to replace the director of Wisconsin’s Elections Commission.