A federal judge partially ruled in favor of the government in a union’s challenge to wage regulations for farmworkers on seasonal visas.