Five Washington investors have agreed to lend $400,000 to Auto-Train Corporation in return for the opportunity to acquire a quarter of the company if they succeed in bringing it out of bankruptcy.

The investors include J. William Middendorf II, president of Financial General Bankshares Inc.; H. Robert Ferneau, another Financial General executive and long-time aide to Middendorf; Langhorne Washburn, a former assistant secretary of Commerce; Carl L. Shipley, a former chairman of the District of Columbia Republican Party; and G. James Frick, a Washington lawyer.

The five already have put up $150,000 in working capital for Auto-Train and are to invest another $250,000 by Dec. 1, under the agreement announced by Auto-Train trustee Murray Drabkin and approved by a federal bankruptcy judge.

Auto-Train filed a petition for reorganization in bankruptcy on Sept. 9 after 10 years of ferrying tourists and their cars between suburban Lorton and central Florida.

The railroad occasionally made money, but after three straight years of losses was forced into bankruptcy because it could neither pay its creditors nor raise additional funds.

Auto-Train is several million dollars in debt, but Drabkin said yesterday he still has not been able to determine precisely how much the company owes and to whom. Accountants have been struggling for months to untangle the company's financial affairs, which Darbkin described as "a mess."

Drabkin said in an interview he is making no predictions about the company's future but is "cautiously optimistic" that Auto-Train can be rescued from bankruptcy now that it has found new financing. "The fact that sophisticated investors have been willing to put up money gives me some encouragement," he said.

The five investors who have agreed to lend money to Auto-Train will play no part in managing the company but under the bankruptcy law can propose a plan for reorganizing the firm and settling its debts. As part of their reorganization plan, the investors can, if they chose to do so, convert their $400,000 loan into 26 percent of the company's stock, under terms of their agreement with Drabkin.

That would make the group the largest holder of Auto-Train shares and give the five Washingtonians clear control of the company. The largest block of stock currently is the approximately 7 percent owned by Auto-Train Chairman Eugene Kerik Garfield who was fired by Drabkin last month.

Garfield reportedly approached the new group about investing in Auto-Train before he was ousted. As part of the loan agreement filed in federal bankruptcy court here, the group said neither Garfield nor any other former officers or directors of Auto-Train are involved in the loan.

Bankruptcy Judge Roger Whalen approved the loan after accountants for Price, Waterhouse and Co. reported Auto-Train was "unable to meet the necessary expenses of its operations" and its finances "would deteriorate over the next several days" unless it immediately raised money.

The proposal, which in effect gives up a quarter of the company for $400,000, is the best of the offers discussed with four groups of potential investors, Drabkin said.

Auto-Train will have to pay only 10 percent interest on the $400,000, well below the 17 percent interest banks are now charging their biggest and most credit-worthy customers. Because of its shakey financial history, Auto-Train has in the past paid 2 or 3 percent more than the prime rate on its loans.

None of the five investors is an experienced railroader, although Washburn is a well-known collector of antique toy trains. Now a vice president of Disney Productions, Washburn was in charge of promoting the U.S. travel industry when he served in the Commerce Department.

A prominent Republican who served as secretary of the Navy in the Nixon administration, Middendorf is a leader of the CIA transition team for President-elect Ronald Reagan and has promoted himself for the job of secretary of Defense.

Shipley is a long-time business and political associate of Middendorf, as is Ferneau, who was Middendorf's top aide at the Navy Department and who became a vice president of Financial General when Middendorf moved there.

Auto-Train has few assets that have not already been claimed by creditors, but the company has one thing of value to potential purchasers -- an accumulated loss of $10 million that could be used as a deduction from federal income taxes. A corporation taking over Auto-Train effectively could avoid paying taxes on $10 million of other income, saving almost $5 million at current corporate tax rates.