The federal government accused the Southern Pacific Railroad yesterday of violating federal law by favoring its freight trains over passenger trains on one of Amtrak's western routes.

In a suit filed in U.S. District Court here, the Justice Department said that the Sunset Limited, Amtrak's Los Angeles-New Orleans train, did not finish a single trip on time from July through October because of the freight interference. Trains routinely ran seven, eight or nine hours late.

"It's kind of embarrassing when someone calls up and asks what day does the Sunset Limited get in instead of what hour," Alan S. Boyd, Amtrak's president and chief executive officer, complained yesterday at a news conference announcing the suit.

The suit alleges that Southern Pacific has been violating a federal law that gives intercity passenger trains preference over freight trains in the use of any line of track, junction or crossing, except in emergencies. Instead, the SP accords preference to its own freight trains, thereby delaying the passenger trains and their travelers, the suit charged.

The SP is one of 21 railroads that have contracted with Amtrak to operate the passenger trains over their lines under the provisions of the law that set up Amtrak -- officially called the National Railroad Passenger Crop. Under the contracts, Amtrak's trains are operated by personnel of the contracting railroads, including engineers and conductors.

The Sunset Limited runs three times a week in each direction on what should be a 2 1/2-day trip. It operates over 364 miles of track between New Orleans and Houston, with all but 22 miles of it controlled by the SP. Although SP's segment comprises only 18 percent of the Sunset Limited's total route of more than 2,000 miles, most of the delays occur on it, the suit alleges.

A spokesman for SP in San Francisco said the railroad's overall record of on-time performance for Amtrak is good and that renovation and modernization of the Texas line had slowed operations recently. He insisted SP follows the law.

Though unconnected, the suit -- a first of its kind -- was filed less than 12 hours after the Sunset Limited struck the caboose of a Southern Pacific freight train near Orangefield, Texas, injuring 50 persons.Officials said the exact cause of the collision was not known.

At his news conference, Boyd said the performance of Amtrak's contracting railroads runs the spectrum from very good to very bad and said he hoped the filing of the suit would "send them a message."

"Our passengers deserve to ride on trains that leave on time and arrive at their destinations on time," he said. "Far too often, that is not happening." t

Delays are particularly disturbing at a time when more and more people are looking to the passenger train as an alternative to the automobile, he said.

The railroads he named as performing well for Amtrak were the Union Pacific, Seaboard Coast Lines, Southern Railway, the Milwaukee Road and, recently, Conrail.