AT A RECENT hearing U.S. District Judge Gerhard Gesell said from the bench: "This is just another rather frequent race case that has come to my attention from this agency which is obviously working its way into a very difficult problem some day in some case with the way it's treating blacks, and I hope you're well aware of that." Which agency? The Department of Agriculture.

Race is not a subject that comes instantly to mind when you think of agriculture. But over the years USDA has developed a pretty ugly reputation on it. There have been repeated complaints about discrimination in the agency's personnel practices and its distribution of services. Some of these have involved the slighting of black farmers, a neglected USDA constituency. Others have had to do with rural housing and development programs -- an important source of support for the rural poor. The agency also represents about 100,000 jobs.

The Reagan administration did not invent the civil rights problem inside Agriculture. Neither has it done much to alleviate it. For a while in the first Reagan term, the monitoring of the department's behavior was given over to a political appointee, Isidoro Rodriguez, whose main contribution was a memo to the secretary suggesting how Agriculture could become the lead agency in vitiating federal civil rights enforcement. A successor, Alma Esparza, was accused by her staff and later the department's own inspector general of having let the enforcement mechanism run down.

For a time in the Federal Grain Inspection Service, it was official policy that supervisors could continue to receive "satisfactory" performance ratings if found guilty of no more than three cases of discrimination. There have been several instances of apparent retaliation against employees who complained of discriminatory practices in the department; most recently, the highest-ranking black woman in the Extension Service was fired while making such a complaint. In the Animal and Plant Health Inspection Service a gag order in the form of "confidentiality certificates" has been imposed on some employees to prevent unauthorized disclosure of personnel histories.

There have been analogous complaints about discrimination in the administration of USDA services -- rural housing loans, operating loans to farmers, funds for soil conservation projects -- particularly by officials at the local level. The local level is where a lot of USDA business gets done -- which critics say is part of the problem.

The committees of Congress with the clearest jurisdiction over the department -- Agriculture and Appropriations -- have shown little interest in these issues. Commendably, a House Judiciary subcommittee led by Rep. Don Edwards has addressed them instead. But that is too oblique a way to proceed. Mr. Edwards has called upon the new agriculture secretary, Richard Lyng, to take the lead. The department needs to have its values tuned up, and that isn't for Congress or the courts to do. It's the secretary's job.