TV movie-of-the-week from 1979 called "Disaster on the Coastliner". Shat played a bad guy on his way to death row via train; when the train becomes a runaway, Shat has an epiphany, saves the day, and is killed for his trouble.
Way, way off. :-) Shatner played a con man who attracts Yvette Mimieux, but he's a "heroic con man with a heart of gold" kind of guy. He separates the engine car from the rest of the train and gets trapped aboard. he and the engineer (who is behind the hijacking of the train) jump off as it soars over a bridge above water. The engineer dies, but Shatner survives. He's taken away by the cops (for his criminal record), but it's made clear that he'll be treated leniently because he saved lives.
The movie was terrible, especially for the fact that it was made up mostly of re-used footage from other movies.
Actually, for a TV movie disaster film, it was pretty good. The cast was semi impressive with former A-list stars and the music by Jerry Fielding was outstanding. Sadly, this isn't on video - at least not in the US.
Impulse is easily Shatner's worst film. It's totally incoherent. Kingdom of the Spiders, however, is really good. Very serious, the spiders are mostly real, too. If spiders have a support group, they would be devastated at the real on-camera deaths of hundreds of them. The ending while betrayed by a bad painting effect, is pure Twilight Zone. Actually, most of the background music is stock library cues from that series.