A federal judge in Minneapolis has ordered the Social Security Administration to restore up to 20,000 mentally ill people in the Midwest to the disability rolls and has held that the standards used to cut them off were "arbitrary, capricious, irrational and an abuse of discretion."

Although the preliminary injunction issued Wednesday by U.S. District Court Judge Earl Larson applies only to Ohio, Illinois, Indiana, Minnesota, Michigan and Wisconsin and only to mentally ill disability beneficiaries, it has national implications for people with all types of disabilities.

In 1980 Congress ordered stepped-up reviews to prune the disability rolls of those well enough to work.

There have been protests ever since on grounds that these reviews have been hasty, superficial and arbitrary, and have resulted in many thousands of unjustified cutoffs. In fiscal year 1982, Social Security reviewed 435,000 cases and ordered 195,000 cutoffs.

It is scheduled to review 640,000 cases this year.

Congress this week in response to protests passed a bill allowing recipients to keep collecting benefits until cases have been decided on appeal to an administrative law judge.

Larson's action, on which the Department of Health and Human Services said it will seek a stay, is the first in which charges against the stepped-up system have been upheld as to a whole class of patients, in this case mentally ill people under 50.

At issue in the case, brought by the Mental Health Association of Minnesota with the assistance of the Mental Health Law Project here, are the standards used by Social Security to determine whether mentally ill people are too sick to work.

Larson said that instead of examining each applicant's capacity to work, as required by law, the Social Security Administration in the Midwest had since late in the Carter administration operated under guidelines presuming that, even if severely mentally ill, a person under 50 who could perform certain normal daily activities also could work.

In fact, Larson said, many severely mentally ill people who get along well enough when at home in a "stress-free, supportive environment . . . deteriorate rapidly in a work situation."

Instead of looking just at the medical condition of applicants, the judge found, Social Security also should have considered their recent work histories, reactions to stressful situations and likely reactions to on-the-job requirements.

The judge said that late in 1980 the regional SSA had started using the faulty guidelines, which he said had then been endorsed by the Reagan administration early in 1981.

He ordered all those pushed off the rolls restored, an estimated 15,000 to 20,000 persons, and proper standards used in the future.

The judge's findings this week are similar to the results of a still-unpublished investigation by the General Accounting Office, requested by Chairman John Heinz (R-Pa.) of the Senate Committee on Aging. Heinz said the GAO had found exclusion of mentally ill people without evaluations of on-the-job capacities, and judgments sometimes "made by people with no training in psychiatry."

Aides said one example was a man pronounced by a psychiatrist as "one of the sickest people I've ever treated." He was excluded from benefits because he was able to "watch TV and go to ball games." In another a patient hospitalized 22 times for mental illness was excluded because he could perform some daily functions.

The bill makes three major changes in general review procedures for physically or mentally disabled people.

One, to be in effect for the next two years, allows beneficiaries who receive a preliminary cutoff notice to keep getting benefits through the appeal process, which can sometimes take a year, instead of being cut off two months after notice.

A second allows HHS to reduce the number of people annually reviewed to less than specified in the 1980 law. And a third guarantees people threatened with a cutoff with a hearing where they can present arguments at an early stage.