She said her train stopped after Westbury without explanation. “There was a whole line of cars” at the grade-level crossing where the train stopped, she said.

She said she heard a westbound train approaching and “making a funny noise.”

“It hit us,” she said. “It hit the last car” of the eastbound train, she said. “The people from the last car were running up, saying ‘Move up, move up because the last car is on fire.’”

A passenger on the westbound train, Mike Picarella, 36, was in the back of the train when, around 7:20 p.m., he heard “a little thump.” He said he didn’t think much of it, but seconds later, there was a second, bigger thump, he said.

“You knew something happened,” Mr. Picarella said. “The train stopped.”

Realizing their train had hit something, the passengers stood up and then looked out the window, where they saw another train. At first many wondered if they had hit it.

But there was a fire raging, too, flames knifing up from underneath the train, halfway up the windows. On the ground below was half of a crumpled vehicle.

Within a minute of stopping, the train started filling up with smoke, Mr. Picarella said, and passengers were quickly moved to the front. Eventually, the doors were opened to let the smoke out, he said, and passengers could then see that a train car had peeled off the tracks.

Mr. Picarella, who is a maintenance manager for New York City Transit, praised the response of local emergency responders and the police, who he said arrived within minutes of the crash, and got people off the train quickly.