In two unexpected developments, the Senate last night approved an administration-backed hospital cost containment plan and the House Rules Committee threw a new obstacle into the path of the president's energy program.

In other actions yesterday, with time running short before tomorrow's scheduled adjournment of the 95th Congress, efforts to find a compromise version of the Humphrey-Hawkins employment bill continued to founder.

And the House refused to pass a $56 billion appropriations bill for the departments of Labor, and Health, Education and Welfare because the legislation contained insufficient prohibitions on federal aid for abortions.

The House Rules Committee sent the most ambiguous signal of the day, splitting 8 to 8 on a proposal to send all elements in the administration-backed energy package to the floor together. This amounted to a victory for opponents of the package's natural gas deregulation provision, who hope to separate natural gas from the other measures and defeat it on the House floor.

Administration lobbyists were working last night to reverse the Rules Committee's action.

On hospital cost control, the Senate gave President Carter an unexpected victory by substituting a bill to his liking for a much weaker Senate committee measure. But the bill may die in the House.

The substitute, offered by Sen. Gaylord Nelson (D-Wis.), would provide for mandatory federal controls on future increases in hospital costs if a voluntary program in progress fails to bring down the rate at which costs are going up from about 15.6 percent a year to 11.6 percent a year within two years.

The Nelson substitute was accepted by voice vote after a motion to table it - kill the idea - was defeated on a 47-to-42 roll call. The bill then was passed and sent to the House, 64 to 22.

This surprised lobbyists for the hospital industry and medical profession, who had expected the Senate to kill the Neslon proposal. It was the first time in this Congress that mandatroy controls on hospital cost increases had been approved in either house.

The vote elated HEW Secretary Joseph A. Califano Jr., who was in the Capitol for the vote, and senators who have been fighting for controls, including Nelson and Edward M. Kennedy (D-Mass.). Before the vote on the Nelson proposal, the Senate defeated a more demanding Kennedy version, 59 to 18.

Califano said after the vote on the Nelson proposal that the administration would do whatever it could to get a vote on the measure in the House before Congress adjourns. But the chances of success seemed remote, since the relevant House committees have refused to approve similar legislation.

Proponents of controls said even if the Nelson measure dies with the adjournment of this Congress, yesterday's vote was an important psychological victory for them in their struggle against the medical industry's influential lobby.

But members of that lobby said some senators voted for the Nelson bill because they knew it would never become law, so they could make some political hay without fear of permanent consequences.

Kennedy estimated that the Nelson measure could save $30 billion over the next five years and reduce federal expenditures on hospital care by $10 billion.

The House's determination to stick with stringent anti-abortion language killed the possibility of a $56 billion Labor-HEW appropriations bill being enacted for this session.

Though the Senate must still vote on the Labor-HEW conference report, it is all but certain to uphold its much more liberal anti-abortion wording. House Appropriations Committee Chairman George Mahon (D.-Tex.) said that means, "This bill's dead for this year."

Instead, the House and Senate are likely to pass a continuing resolution, which has no moeny figure but continues funding at about the current rate of operations for Labor-HEW departments and programs.

The continuing resolution, as it passed the House, also contains money for the Department of Defense and, as it passed the Senate committee, funds for the Department of Energy contained in a public works appropriation section.

The House approved a separate $117 billion defense appropriations bill by voice vote early last night and the Senate was expected to do the same before the night ended. That would eliminate the need for the defense funds in the continuing resolution.

This is the second year in a row that the Labor-HEW bill has been delayed by the abortion issue. Labor-HEW funds were held up for six months last year.

Last December the House and Senate agreed on carefully worked out language that would prohibit federal funding of abortions through Medicaid except where the life of the woman is endangered, where severe and long-lasting physical health damage to her would result if the pregnancy were carried to term, when so determined by two physicians and for medical procedures necessary for the victims of rape or incest when the crime has been "promptly" reported to the proper law enforcement agency or health services agency.

But antiabortion forces, angered at how HEW interpreted that language, prevented adoption of a similar compromise this year. HEW regulations, for instance, allow 60 days for the reporting of rape and incest. Rep. Henry Hyde (R.-Ill.), chief proponent of a strong abortion ban, charged that 60 days does not fall within the meaning of "promptly."

This year Hyde insisted on his original language limiting abortions except where the life of a woman is threatened, and the House went along.

The Senate adopted more liberal language, prohibiting abortions except where the life of a woman is endangered and when "medically necessary" for rape and incest victims.

Yesterday, Mahon attempted to get the House to accept last year's language, arguing that was the practical thing to do. Others pointed out that last year's language had cut Medicaid abortions from about 250,000 than 2,300, or by about "99 percent."

But Hyde insisted he would not be satisfied until "we get the government out of the business of paying for killing unborn children."