The Maryland Senate gave Gov. Harry Hughes a major defeat tonight by rejecting a proposed gasoline tax increase that the governor advocated as a means of bolstering the state's sagging revenue picture.

Meanwhile, the House easily passed in weakened form the other major revenue measure in Hughes' $68 million tax and spending package -- an increase in fees charged to heavy trucks which is expected to generate $12 million to maintain the state's deteriorating bridges.

The proposed gasoline tax increase, which would generate $20 million by adding one penny to the present 9-cent-per-gallon tax, is to be reconsidered Friday, but today it was rejected by a surprisingly large 29-to-18 margin. It was the biggest cornerstone of Hughes' revenue and spending plan, which represented his major legislative initiative of the 1981 session.

The mixed results came at the end of a day in which Hughes also came under intensifying political pressure to toughen his corrections policy. Even as he forcefully defended his record at a press conference, Hughes began backing away from his longstanding resistance to additional prison construction measures.

The sponsor of the gasoline tax bill, Sen. Laurence Levitan (D-Montgomery County), angrily accused Hughes of not pushing for it hard enough. Hughes had predicted at a press conference one hour before the vote that the bill "has a good chance" of passage.

Levitan portrayed the Friday vote on the bill as a major test for Hughes. "Let's see what the governor can do," Levitan said. "He [Hughes] didn't have any part in it. He didn't try to get votes until the end. I can't understand while they voted against it like that." Hughes declined comment through a spokesman.

The opposition came largely from outside the urban regions of the state, as senators from southern and western Maryland predicted that the money generated by the tax would be used largely for road projects in Baltimore. "There's no equity there. We are going to tax again and the same old people will get the money," Sen. James Simpson, a southern Marylander, complained during the debate.

As Senate President James Clark (D-Howard) warned that senators would be neglecting their fiscal responsibility by voting against the measure, critics called the gas tax campaign "political blackmail." Calling the vote "a big mistake," Levitan said to his colleagues: "You all found excuses not to vote for it."

Hughes' shift on the prison issue came a month after he had publicly opposed a Senate bill that would appropriate planning money for a new 500-bed state prison. Today, in a letter to two legislative committees, he threw qualified support behind the measure, asking that the money be appropriated, but not spent until next October so that he and legislators can have time to study whether a new facility is needed.

Hughes realized, according to an administration source, that the legislature was going to pass the bill, with or without his approval, and wanted to get it amended to meet his own timetable.

While Hughes asserted that his policy remains unchanged, his message was greeted by legislators as a sign that the recent turmoil in the prison system -- and the political fallout from it -- have forced the governor to toughen his tone.

The turmoil, which led this week to the resignations of Hughes' two top prison officials, began with the indictment of 27 minimum security inmates on charges they committed serious crimes while they were supposed to be attending jobs and classes in Baltimore.

It escalated today as three more prisoners escaped from minimum security facilities, and as Anne Arundel County Executive Robert Pascal, a likely Republican challenger to Hughes in 1982, publicly accused the governor of neglecting public safety through his corrections policies.

An agitated Hughes, confronted with the latest developments, complained that the prison system's extensive problems predated his administration and are not unique to Maryland.

"It's very easy to say my policies caused all this, and it's absolutely wrong," Hughes said. Responding to Pascal's comments, Hughes said testily: "I think that's an irresponsible statement, and let's not kid ourselves, it's obviously politically motivated."

The Senate Budget and Taxation Committee, responding to Hughes' new support for its prison appropriation bill, passed the measure today with the amendments Hughes wanted. It would appropraite $800,000 in planning money for a new facility. The Senate panel also cut from the 1982 budget all money for new minimun-security, community-based prison facilities previously advocated by Hughes and his recently departed corrections chief, Gordon C. Kamka.

Meanwhile, the House Appropriations Committee reacted angrily to Hughes' request and postponed at least until Friday a vote on a prisons appropriations bill. Said Del. Mark Medairy Jr. (D-Baltimore County): "There's a tremendous amount of frustration on this committee. We don't know whether this is a substantive change or he's just trying to buy time."