A U.S. District Court judge ruled yesterday that federal agencies must give equal pay benefits to government employes who appear in court as witnesses in discrimnation cases whether they are testifying for or against the government.

Judge Harold H. Greene, acting in the case of a U.S. Postal Service worker, rejected the government's argument that it was in its interest to pay employes testifying on behalf of the government but not to compensate those employes who were on the side of the person bringing the discrimination complaint.

In a 14-page opinion, Greene said that the government has a "substantial interest" in eliminating race, sex or age discrimination in its employment ranks. Greene said that precludes any attempt by the government to put "artificial obstacles" -- like payless witness days -- in the way of employes who want to bring discrimination complaints against the government.

In the case of postal worker Kenneth W. Davis, Greene noted, witnesses on his side had to come to court to testify for him on their own time, while witnesses for the government were given administrative leave to testify and were paid as if they had been at work. Davis, a 45-year-old black man who has worked as a technician at the Washington Bulk Mail Center, claimed he was denied promotion on account of his race, sex and age.

Greene said that the postal service policy on witness compensation, which is apparently followed in most other government agencies, is inconsistent with both the Civil Rights Act of 1964, and the Equal Employment Opportunity Act of 1970. Both those laws were intended to provide effective, straightforward procedures for employes to press their discrimination complaints within the government, free from any unnecessary burdens, such as payless witness days, Greene said.

Greene turned down Davis' discrimination complaint but he said that the postal service must compensate Davis and coworkers who testified in his behalf in the same way that it compensated witnesses for the government.