A federal judge has upheld a decision by the U.S.