SUNNYVALE — When Walter Wilson first saw the headlight of a train heading in his direction Thursday evening, he knew time was running out. Wilson was trying to get an elderly woman who had driven onto the railroad tracks at Sunnyvale Avenue to back up to safety, but with the train fast approaching, he had just one option.

“We’ve got to move, and move fast,” Wilson said to himself.

Wilson, 63, unbuckled the woman’s seat belt, pulled her out of the car, which was 45 to 50 feet down the tracks, and helped her to safety. As they reached the sidewalk, the train crashed into the car, pushing it about 100 feet until it flipped in the air, Wilson said.

“The train hit that car and it crumbled like a piece of paper,” said Wilson, a longtime social-rights activist and a member of the Black Leadership Kitchen Cabinet of Silicon Valley.

Friday, public safety and transit officials hailed Wilson as a hero, saying his quick-thinking saved the woman’s life.

“Whenever we can avoid any sort of tragic situation, as we did (Thursday) night, I think it’s a great thing,” said Caltrain spokeswoman Tasha Bartholomew. “I think we need more concerned citizens that look out for each other. I’m grateful that gentleman thought enough to check on the woman. He knew it wasn’t safe for her to stay in her vehicle. For me, and as an agency, we appreciate that people are looking out for each other.”

Wilson said he was driving to the Home Depot in Sunnyvale to get materials for his son’s school project when he noticed a car stopped on the tracks just before 6 p.m. He stopped in the intersection, put his hazard lights on and ran to the car to make sure it was unoccupied.

Instead, he found an elderly woman behind the wheel.

He looked in both directions. No signs of a train. So Wilson tried to get the woman to back up enough to get into the intersection. The woman seemed confused, Wilson said.

Then he saw the train’s lights from a far distance. Wilson immediately recalled a piece of information someone had told him years ago: Trains move faster than you think.

“When I looked up and saw that train, I thought, ‘Do I have time to get this car off this track?’ ” Wilson recalls thinking. “ ’No , I don’t have time. Forget this car. Let’s get this lady to safety.’ ”

Wilson rushed the woman to the sidewalk just in time.

Caltrain did not release the woman’s name, and on Friday morning Wilson still didn’t know it either. After the crash, he was told the woman’s son arrived to pick her up, but he didn’t get a chance to meet them.

“It was a scary moment,” Wilson said, “but I’m glad I was the one who was there.”