Unexpectedly high returns from state sales and income taxes and the state lottery are expected to produce a budget surplus of almost $300 million in Maryland, Gov. Harry R. Hughes announced today.

The latest forecast, boosting the expected surplus by $64 million over the highest previous estimate, has presented the governor and the General Assembly with a reservoir of funds to provide politically popular tax relief -- a reservoir so large that legislators are not certain of the best way to spend it.

For Hughes, who has asked the legislature to approve a plan that would return more than $100 million to taxpayers next year, the constantly growing surplus creates "an obligation to return a certain portion to the people. The problem is," he said today, "the best way to go."

"It's kind of ironic," said House Speaker Benjamin L. Cardin, the legislature's acknowledged tax expert, "but I'd say the tremendous surplus has actually made the situation less certain than it used to be in terms of what tax relief programs will come out. When you have a hundred million or so floating around there, it's hard to tell how the legislators will react to it."

Despite this uncertainty over the surplus, however, it became evident this week that Hughes and legislative leaders are moving closer to agreement on what Cardin called "a modest package" that will be of greatest benefit to the state's middle-income homeowners.

Cardin predicted that the package will include the following main components:

Elimination of the 5 percent sales tax on electric, gas and home heating oil bills, which would result in an estimated total savings of $35 million for state residents and an individual savings of about $30 per year for the typical ratepayer. Hughes originally proposed that this utility tax merely be cut in half -- to 2.5 percent -- but a Senate committee voted this week to eliminate it altogether. Cardin and other legislative leaders expect Hughes to accept that decision.

An increase in the standard income tax deduction allowed taxpayers who don't itemize on their tax forms, from $500 to $1,500 for individuals and from $1,500 to $3,000 for families. Many legislators opposed this concept when Hughes first proposed it, arguing that it would not benefit their homeowner constituents, who rarely use the standard deduction. But Cardin and other legislative leaders said this week that the measure will probably pass.

An increase in the benefits of a property tax credit program known as the "circuit-breaker," which allows homeowners who are disabled or over 60 years old to deduct up to $900 from their property taxes and other homeowners who earn $15,000 or less annually to deduct up to $450 from their tax bills. This year's proposal would boost the deduction for those who earn $15,000 or less to the $900 level.

Elimination of the 2 percent sales tax on manufacturing and farm equipment, which would save state industries and farmers an estimated $10.8 million annually, and, in the words of House Ways and Means Committee vice chairman Gerald Devlin (D-Prince George's), "convince American businessmen that Maryland is interested in industry."

A distribution of more than $60 million in state funds to the 23 counties and Baltimore City, about half of it in the form of state aid to education and the other half simply through the return of unclaimed withholding taxes. These funds are expected to help the local jurisdictions reduce their property tax rates.

The program that faces the greatest opposition in the legislature is the "circuit-breaker" property tax credit program. Although endorsed by Hughes and Cardin, "There's a feeling that renters benefit enough from the income tax deduction," said one House leader.

The total amount of relief resulting from this year's package is as difficult to accurately assess as the ever-bulging revenue surplus, but most tax experts here say it will exceed $100 million. The relief stemming from the "circuit-breaker" property tax credit program is particularly hard to predict.Last year, the state budgeted more than $20 million for that program, but so few homeowners took advantage of it that only $3 million was actually spent.

Although characterizing the total package as modest, Cardin said that it was "a definite improvement in the state's regressive tax structure." He said the elimination of the utility tax was particularly important "because that is by far the most regressive tax."

The second most regressive Maryland tax, in Cardin's opinion, is the state income tax, which now has only two tax brackets. For the last four years, many legislators here have been expecting Cardin to push for a major reform of the income tax by creating more tax brackets. "We keep waiting for him to do it," said Devlin, "but it's always been like the old Brooklyn Dodgers rallying cry: 'Wait 'til next year.'"

Cardin, in an interview today, said he hoped that "next year" will finally arrive in 1980. "I'm a realistic type guy," he said. "This was not the year to push a major bill like that. It wouldn't be fair for the new governor and new legislature. Next year, we'll have the chance to really deal with it."

Many of Cardin's colleagues, however, say they would prefer to keep tinkering with other tax relief programs and leave the income tax the way it is. "Whenever you talk about income tax reform, you're talking about higher taxes for the middle-class homeowners who know how we vote," argued Devlin. "It would be very popular. I'm satisfied with the type of program we have this year. It's geared toward the middle-class, the suburban homeowner."