The secretaries of Transportation and the Interior in an attempt to resolve one of the longest-running problems in town, have decided that two-thirds of Union Station should be used for transportation purposes and the rest as a visitors center for the Nation's Capitol.

That means that Transportation would claim much of the grand old structure from Interior, which now uses it solely as the National Visitor Center. The Amtrak train station, with its motel Jobby decor, is stuck in back. There is no parking because cost overruns stopped completion of a garage.

The cost of reclaiming part of Union Station for the railroads and finishing the garage could reach about $45 million, according to a preliminary study just completed for the Federal Railroad Administration.

Transportation Secretary Brook Adams and Interior Secretary Cecil D. Adams outlined their agreement in a letter to Senate Commerce Committee Chairman Warren G. Magnuson (D. Wash.).

Under the agreement, the National Visitor Center would continue to occupy the central area in the old Union Station building. The multiprojector slide show in a sunken theater, two movie theaters, a book store and the presidential suite would remain where they are now.

The rest of the 1908 building, plus the new motel lobby railroad station, would be reconstructed for ticketing, baggage handling and other railroad purposes. One option under study would bring the trains back into old Union Station.

Completion of a 1,200 space parking garage over the railroad tracks behind Union Station will cost about $12 million, according to the new study. At the moment, a completed portion of that garage is used as a Metrobus terminal.

The car parking section was never built because Interior had to stop construction when cost overruns outran the money. The whole garage project was originally projected to cost $18 million when it was started in 1973; by the summer of 1976 when construction stopped about $40 million had been spent. The construction contract, to the George Hyman Construction Co., was awarded without competitive bids, The Washington Post reported.

At the same time, $18 million was spent for the new railroad station (behind the old one) and $8.5 million to rehabilitate the old station and turn it into the Visitor Center.

The result has offended architectural critics and train passengers alike. Critics dismiss the slide show theater as a "hole in the ground" and decry the carpeting and plastic fixtures that have been placed in the old station's concourse.

Train passengers find that it is one-third of a mile from the front of the Visitor Center to the train platform. Signs are confusing; ticket counters are hidden from view. Amtrak president Paul V. Reistrup tried to help out one day and discovered later he had been misdirecting passengers.

A Federal Railroad Administration task force was set up under Charles Swinburn last summer to study the Union Station problem.

"Considering the history of this thing, we decided to start from scratch and accept nobody's preconceived opinions," Swinburn said yesterday. "We turned loosed the Northeast Corridor architects and engineers to evaluate the complex.

Swinburn's consultants have told him that improvements to roads and access ramps could cost $5 million to $6 million. It will take between $5.5 million and $14 million to reinforce the north wall of the original Union Station building and the tunnels that carry passengers from Union Station under Capitol Hill to the Potomac River crossing.

Conversion of the old building and new station into an effective railroad terminal, with heating and air conditioning, good plumbing and convenient train platforms, could cost another $12 million.

The task force's work will contribute to a final administration decision on what to do at Union Station and on ways to finance it, Swimburn said.

Adams and Andrus will then jointly seek legislation from Congress to make the Transportation Department the prime agency at Union Station and to fund some of the reconstruction.

Much of the money could come from existing funds to rehabilitate railroad stations in the Northeast Corridor - a program for which Magnuson's committee has Senate responsibility. Other funds, including federal highway and urban transit, might also be tapped, Swimburn suggested, "Every time one of the senators comes in on the train, they throw up their hands and ask us to get something done about Union Station," one Senate staffer said.