Buster Keaton's silent film classic is still a remarkably entertaining film.
The General
(1926)

Johnnie Gray (Buster Keaton) is a train engineer.  His two great loves are his locomotive, named "The General", and his girl Annabelle.

The civil war has begun, and Annabelle's family join the confederate army.  Johnnie tries to enlist, but is refused because he his too valuable as a train engineer.  Annabelle and her family mistakenly believe he did not enlist due to cowardice.  She sends him away, telling him she does not want to see him again unless he is in a uniform.

Later in the war, Annabelle's father is injured, and she goes by train to visit him.  She is traveling on Johnnie's train.  Union spies arrive to steal a train, so they can travel north destroying all the railroad bridges.  They steal The General with Annabelle aboard.  Johnnie sets off in pursuit on a second train.  By the time, Johnnie catches up, they are in Union territory.  Johnnie has to go into hiding.  Johnnie happens to hide in a house that is where the Union general is staying and where Annabelle is held.  While hiding, Johnnie hears the Union plans for a surprise attack.

Johnnie dresses as a union soldier.  He rescues Annabelle, and together they steal The General back and head south.  During this, a union general is knocked out in the back of the train.  They reach the confederate army, where Johnnie tells the confederate general of the attack plans.  The confederate army is ready and repels the attack.  Johnnie's blunders and errors are very helpful.  For example, he fires a cannon in the wrong direction, but it hits a dam, flooding the union troops.

When the battle is over, it seems that everyone else but Johnnie is getting credit.  He returns to The General, where he finds the union general just waking up.  Johnnie brings him at gunpoint to the confederate general as a prisoner.  The confederate general makes Johnnie a lieutenant, with Annabelle and her family watching.  Johnnie finally wins the heart of Annabelle. 

Thanks Joseph C!