Norfolk Southern Chairman Robert B. Claytor said today he is "cautiously optimistic" that his company's $1.2 billion offer to purchase the federal government's share of Conrail will win congressional approval.

While Claytor was speaking at a meeting with financial analysts here, opponents of the Norfolk Southern acquisition scored a victory in Baltimore. Maryland Gov. Harry Hughes announced that "it is clearly in the best interests of the state" to support a rival proposal for Conrail, that of an investor group put together by Morgan Stanley.

Hughes' announcement came at a press conference with John W. Snow, president and chief executive officer of Chessie System Railroads, a subsidiary of Norfolk Southern's arch-rival CSX Corp.

CSX was a prime mover in getting the Morgan Stanley investor group off the ground, and it has a 7 percent stake in Morgan Stanley's offer, also of $1.2 billion. Morgan Stanley's group is pledged to resell at least 60 percent of its Conrail holdings to the public within five years.

Hughes' endorsement came after Snow announced an agreement with Maryland that should increase the Port of Baltimore's share of container traffic destined for the Midwest because shippers moving containers from Baltimore to the Midwest will get a 20 percent cut in current transportation costs. That also could divert traffic from Norfolk Southern, which has heavy international container movements through Norfolk.

Claytor noted in his comments to analysts today that the battle for Conrail "has turned into a real Donnybrook . . . Despite the intense lobbying of CSX, Conrail and Morgan Stanley, I will make a prediction that the so-called public offering will get absolutely nowhere."

"It's sometimes darkest before the dawn and I think we've reached that point," Claytor said. "There has been a lot of commentary to the effect that Norfolk Southern is going to give up. Norfolk Southern is not going to give up. We think we will win."

Claytor said during an interview later, however, that nothing in his comments changed his oft-repeated statement that, if there is little progress in Congress by the end of the year toward approving Norfolk Southern's proposal, it will withdraw its offer.

"If the Senate has approved it, but not the House, that would be substantial, and we would not call it off," he said. "But if it's hopeless, if there is no progress, then we would exercise our judgment."

The Norfolk Southern offer, strongly backed by Transportation Secretary Elizabeth Hanford Dole, is expected even by Morgan Stanley advocates to win in the Senate. An attempt to reach an agreement to limit debate on the floor stalled late last week and it is now expected that the earliest a vote could come would be in September.

In the House, however, the outlook is much less certain, and some Norfolk Southern backers fear that the Morgan Stanley proposal has the ability to create a stalemate and result in no sale at all.

Morgan Stanley has gained some endorsements in recent weeks. Five states in the Upper Midwest -- Minnesota, Nebraska, North Dakota, Iowa and Wisconsin -- have come out in support of a "stand alone" Conrail in recent weeks.

In a joint position paper released today, those states expressed concern that a Norfolk Southern acquisition will drive traffic away from the smaller midwestern railroads and force them to "react to the loss of revenue and traffic by curtailing service, deferring maintenance and abandoning lines." The unexpressed fear is that the result will be higher rates to ship grain.

The House Energy and Commerce Committee, working with data developed by the Interstate Commerce Commission, is attempting to assess the impact of diversions that a combined Norfolk Southern-Conrail would have on other railroads. The Justice Department is studying the same thing.

Maryland's support of Morgan Stanley is not surprising. CSX has 6,000 employes in Maryland on the Chessie System. CSX estimates that Norfolk Southern's acquisition of Conrail would divert enough traffic from CSX to result in a short-term loss of 700 jobs in Maryland and a potential long-term loss of 2,000 to 4,000 jobs, according to spokesman Ed Edel. Federal Railroad Administrator John Riley challenges those numbers.

Norfolk Southern's first-half results, released here today, reflect the kind of financial and managerial strengths that Dole said she was looking for to assure the long-term viability of railroading in the Conrail territory.

Net income for the second quarter was $138.7 million ($2.20 a share), up from $136.1 million ($2.16) in the same quarter a year earlier. Second-quarter railroad operating revenue of $892.4 million were down 3 percent from the same period last year. "Traffic is down, but our financial performance is encouraging," Claytor said.

Six-month net income was $238.5 million ($3.79), compared with $239.3 million ($3.80) in the first half of 1984.