After years of impasse, the House District Committee for the first time fashioned a compromise plan yesterday on the future of St. Elizabeths Hospital that the District, the Reagan administration and the hospital employes union all seem ready to accept.

If the precarious compromise holds, there is a possibility that Congress could resolve the decades-old issue this year, even though the time is short.

The bill passed by the committee would transfer all responsibility for St. Elizabeths from the federal government to the District by 1991.

How and when to do this, and how to share costs at the 127-year-old facility, has been a controversial issue between the federal and city governments for years, and has brought the mental hospital to the brink of crisis several times while the two governments squabbled over their responsibilities.

Committee Chairman Rep. Ronald V. Dellums (D-Calif.) said yesterday he believes Congress can enact the compromise bill this year. Spokesmen for all three involved groups have indicated they could support, or at least not oppose, what the committee finally passed, he said.

The bill is scheduled for House action Monday. The Senate has not acted on St. Elizabeths legislation and would have less than three weeks to do so before Congress' scheduled adjournment Oct. 4.

The committee measure would:

*Turn over management of the hospital to the District in 1987.

*Provide a declining federal subsidy to D.C. for the hospital through 1991, totalling more than $300 million over a six-year period.

*Require the city to develop a comprehensive mental health system for the District, to be in place by 1991.

*Protect the rights of current hospital workers, including priority in hiring in the new D.C. system and guarantees that they would not lose pay, seniority or benefits under the new system.

Mayor Marion Barry said in a statement that he is "pleased with the outcome of these negotiations and with the prospect that we can have final legislation this year to resolve these longstanding problems."

One amendment hammered out in last-minute meetings between the mayor's office and the American Federation of State, County and Municipal Employees (AFSCME) would give current hospital workers priority for jobs at the D.C. Department of Human Services, D.C. General Hospital and local positions in the U.S. Department of Health and Human Services.

Another change in the bill would transfer all of the St. Elizabeths property to D.C. in 1987.

Bill Welsh, AFSCME director of legislation, said after the bill was adopted that his group would not engage in any "blocking tactics" and that the compromise appeared to be "the best we can get."

AFSCME had objected to parts of an earlier draft, and congressional aides said the union could easily have blocked passage of the measure this year if those concerns were not addressed.

The Reagan administration has not given official approval to the compromise plan, but members and congressional staff aides said officials have told them the adminstration will not object to it.

Ed Darrell, spokesman for the Senate Labor and Human Resources Committee, which has jurisdiction over the St. Elizabeths legislation, said it is "up in the air" whether the bill can pass this year.

While no objections have been raised so far, the committee is only now starting to focus on the House proposal, and it is late in the session, Darrell pointed out.

One House staff aide said that if legislation is not passed this year "all bets are off . . . and we would have to start all over again from square one. We're passing the buck to the Senate, and they would have to take the blame for [failure to get a bill]."