CAYCE, S.C. — Amtrak suffered its third high-profile crash in less than seven weeks early Sunday when a passenger train traveling on the wrong track slammed into a stationary freight train in South Carolina, killing two people and intensifying worries about the safety and reliability of passenger rail service in the United States.

Although the crash was the subject of a federal inquiry on Sunday, Amtrak’s chief executive, Richard H. Anderson, said that a signal system had been down and that dispatchers from another company, CSX, were routing trains at about the time of the wreck. The passenger train, heading south, was diverted onto a rail siding where, while apparently traveling below the speed limit, it crashed into a CSX train that had been loaded with automobiles.

But with the specific sequence of events and cause of the crash unlikely to be settled for many months, the episode, which injured at least 116 people and allowed thousands of gallons of fuel to spill, posed a new challenge for an already beleaguered Amtrak.

By one crucial metric, Amtrak is stronger than ever: In its most recent fiscal year, it posted a record-high ridership of about 31.7 million passenger trips. Yet a series of fatal accidents in recent months have triggered a test of confidence in the rail service.

“Amtrak has put a question in people’s minds,” said James E. Hall, a former chairman of the National Transportation Safety Board, which is investigating the crash in South Carolina.

On Wednesday, a train carrying Republican members of Congress to a retreat in West Virginia hit a garbage truck in rural Virginia, killing a passenger in the truck. And in December, a passenger train on a newly opened Amtrak route jumped the tracks on an overpass near Seattle, slamming rail cars into a busy highway, killing at least three people and injuring about 100 others.

Federal Railroad Administration statistics have shown that in recent years the agency has had an average of about two derailments a month, accounting for about one-quarter of the accidents it reports.

Derailments rarely cause more than minor injuries, but the aftermath was tragically different on Sunday not far from Columbia, the state capital.

Gov. Henry McMaster said the engine of the Amtrak train, which had been carrying eight crew members and 139 passengers on its route from New York to Miami, was “barely recognizable.”

“It’s a horrible thing to see — to understand the force that this involved,” Mr. McMaster said.

The Lexington County coroner, Margaret Fisher, identified the dead as Amtrak employees: the train’s 54-year-old engineer, Michael Kempf, of Savannah, Ga., and a conductor, Michael Cella, 36, of Orange Park, Fla. Both men were in the first car of the train.

“We should have had a lot more casualties, but we didn’t,” she said.

Dozens of passengers were taken to a nearby middle school, where the American Red Cross set up a temporary shelter and passengers tried to make sense of what had happened aboard Train 91 at about 2:35 a.m. on Sunday.

“It just started shaking, you could actually feel the cars hitting the back of our train,” said Samuel Rodriguez, an unemployed metalworker from Brownsville, Brooklyn, who had been sitting beside his mother as they traveled to Florida. “Smoke. Screaming. I went to pick up one kid, checked my mother out to see if she was all right: ‘Ma, you all right? Don’t move.’”

Mr. Rodriguez continued: “That’s when I went between aisles, and I saw a kid bleeding all over, his skull was showing, and his mother was in shock. So I run to the back, try to get to the bathroom. Bathroom’s tore up, toilet bowl’s out, everything’s a disaster, and I’m like, ‘Wow, I’m still walking.’”

He said his mother suffered a fractured nose and injured her leg in the crash, and was released from Lexington Medical Center in Columbia.

Officials said that about 115 other Amtrak passengers had been transferred to local hospitals. The CSX train did not have any passengers on board, Mr. McMaster said.

In a post on Twitter, President Trump expressed his condolences to victims of the crash and thanked emergency workers. Representative Joe Wilson, a Republican who represents this area, visited the Red Cross shelter and said he remained confident in Amtrak. But days after being aboard the train that derailed in Virginia, Mr. Wilson suggested that his experience on Sunday of seeing first responders and shaken passengers had been deeply unusual.