|Juarez (1939) [Emperor Maximilian von Hapsburg]: Executed by a firing squad. (I don't know whether the movie ends before or after the execution.)
The Man Who Lost Himself (1941) [John Evans/Malcolm Scott]: Playing a dual role, "Malcolm" is killed (off-screen) in a subway accident. ("John" survives the movie.)
Smilin' Through (1941) [Sir John Carteret]: Dies of heart failure after falling asleep in his chair while playing chess with Ian Hunter; his spirit rises from his body (appearing as he had in youth) and joins Jeanette MacDonald's spirit. (Thanks to Joe)
Titanic (1953) [Captain Edward John Smith]: Drowned (off-screen) in the sinking of the Titanic; the movie ends before the ship has completely sunk, but his fate is a matter of historic record.
Lancelot and Guinevere (1963) [King Arthur]: Killed (off-screen) by Michael Meacham; we learn of his death afterwards when George Baker informs Cornel Wilde. (Thanks to Gordon)