A labor union effort to invalidate President Reagan's decision limiting pay raises for federal workers was rejected yesterday by a federal judge.

U.S. District Judge Oliver Gasch upheld the constitutionality of the 1970 Federal Pay Comparability Act, which permits the president to give smaller raises than those recommended in a survey of comparable jobs in private industry.

Lawsuits by the National Treasury Employees Union and the American Federation of Government Employees had contended that the act was invalid because its provision allowing either the House or the Senate to veto the president's action ran afoul of a U.S. Supreme Court decision two years ago outlawing the one-house veto.

But Gasch said that the Supreme Court ruling itself and a recent decision by the U.S. Court of Appeals here allowed the rest of the law to be severed from its unconstitutional provision.

Gasch noted that Congress still has the power to reject the president's pay decision through its normal legislative authority, and in fact did so with Reagan's original decision on federal pay in 1983.

The judge also ruled that NTEU had misread the act when it claimed that Reagan acted improperly in delaying last year's pay raise from October to January.