A group of North Carolina railroad buffs went into federal court in Alexandria yesterday, accusing a rival group of Virginia train fans of sidetracking their 45-ton locomotive.

The Carolinians charged that the engine, a 1944 300-horsepower H.K. Porter diesel, was given to them by the owner of a defunct Virginia railroad, but it was diverted to a rail museum in Roanoke before it could be driven or hauled south.

Members of the North Carolina Railway Museum in New Hill, N.C., near Raleigh, want what they say is their engine back and they've stopped saying please. Their lawsuit alleging fraud asked for a total of $200,000 in damages.

"It's here," said Beverly T. Fitzpatrick Jr., president of the Virginia Museum of Transportation in Roanoke. "We believe we followed all proper procedures in getting it here. And obviously we intend to keep it here."

Fitzpatrick said he had not seen the lawsuit and could not comment on it.

The museum's executive director, Nancy McBride, told a Roanoke newspaper recently that the locomotive is a "key piece in the transition from steam to diesel . . . a real rare find."

The engine, in mint condition and on display in Roanoke, was the last one belonging to the Virginia Central Railway, whose president and sole stockholder last year was David E. Wasserstrom, a Pennsylvania lawyer.

Wasserstrom wrote to the North Carolina rail enthusiasts Oct. 4, giving them title to the engine, plus all its spare parts and manuals, according to court papers. The train at the time was parked on a leased stretch of track in Fredericksburg.

Wasserstrom was contacted later, however, about donating the locomotive to the Roanoke facility, which is recognized by the Virginia General Assembly as the state's official transportation museum. Wasserstrom allegedly agreed.

While the North Carolina group still was trying to arrange to drive or haul the engine out of Virginia, the Roanoke group trucked it away.

Wasserstrom, who could not be reached yesterday, told the Roanoke newspaper he believed the train would be removed "right away" to North Carolina. When it wasn't, he said: "I had to do something about it quickly."

McBride said recently she could understand why the North Carolinians were upset.

"We're not upset. We're enraged," countered Charles Moody of the North Carolina museum.