In the early part of the 19th century the ranks were:
Midshipman,
Lieutenant,
Commander,
Captain.
The rank of Lieutenant-Commander was not introduced in the RN until, I think, 1914.
I have come across some instances of Lieutenants being granted the rank of Commander upon retirement.
Have you tried searching in the London Gazette?
http://www.london-gazette.co.uk/searchStephen