A federal judge yesterday ordered the Richmond, Fredericksburg & Potomac Railroad Co. to revamp its procedures for hiring locomotive engineers, an order that follows an earlier ruling that the railroad kept women out of its engineer training program.

District Court Judge Richard L. Williams, ruling on the amount to be granted two Virginia women who sued the railroad in May, said the company's selection process for the high-paying positions is "the real thing that needs to be cleaned up here." He directed the company to take specific steps to address its past discrimination and what he called "a scheme seized upon by the railroad to avoid hiring any women" as engineers.

In August, Williams found that the railroad had discriminated against two clerks, Doris M. Davis of Alexandria and Sandra Jean Hylton of Richmond, by denying them admission to an engineer apprentice program for nearly 10 years. That ruling came after a one-day trial during which several witnesses testified to the RF&P's informal system of recruitment, hiring and promotion.

Fred Alexander, the railroad's attorney, said "it is very likely" the company will appeal the rulings. "We maintained we haven't discriminated in any way, shape or form," he said.

Williams held yesterday that Hylton, 36, should receive back pay as an apprentice engineer retroactive to January 1983. Hylton, who said she first applied for the program in 1975, should have been admitted to the program in January 1983 when a male employe with less seniority and no greater qualifications was accepted, the judge said.

Kenneth Labowitz, the attorney representing both women, estimated the amount due Hylton at $29,000 but said that it could increase depending on when Hylton enters the apprenticeship program.

Williams denied any back pay to Davis, 57, who has been found unqualified for the program because of a back problem.

During the trial and again yesterday, the railroad contended that women, including Hylton and Davis, were not interested in, and had rejected jobs that lead to becoming engineers. The company's practice of hiring experienced engineers, virtually all of them male, is just good business, Alexander said yesterday.

The judge said he would monitor the railroad's hiring and he outlined steps it must take to address its past discrimination.

His order requires RF&P to prepare and publish eligibility requirements for the apprentice engineer program, post notices 30 days before the application period is closed and appoint a committee to make the selections. The committee, which Williams said should not include individuals who had discriminated against Hylton and Davis, must publish the reasons for its selections.