Picking up on the theme of National Archives War Office records, you might have some luck with WO 28/304, "General Orders issued on behalf of the Commander of the Forces in Canada [Lieutenant General Sir George Prevost] by the Adjutant General's Office at the headquarters in Quebec.", covering 20 February to 18 October 1812.
WO 28/303 (similar records from a slightly different department) goes up to 25 August 1812, which probably means it won't contain what you're after, but there's a slim possibility it'd be useful.
WO 28/304: The orders cover the following subjects: [...] courts martial [...] exchange of prisoners of war [...] surrender of Detroit [p.163]
It feels like there's a reasonable chance names will be listed there, or at the very least some form of clear indication of whether sailors as well as soldiers were captured and identified. No guarantees, of course, but it's a start.
Another potentially useful resource is WO 90, "registers from the Judge Advocate General's Office of general courts martial confirmed abroad from the end of the eighteenth century", but this is several volumes long and there does not appear to be an index to it.
Again, though, you'll have to get someone to do the copying for you; it's not yet digitised. Paying for an entire volume on spec is going to be expensive; going yourself (if in the UK) or commissioning a researcher might be cheaper.
It's also possible that we're chasing a red herring by looking at War Office court-martial records. The services were very demarcated in those days, to the point of answering to different ministries, and it's quite plausible that the Army wouldn't have wanted to try a sailor (or a marine?) even had they caught an admitted deserter. He might have been slung in the back of a cart and handed over to more appropriate authorities as and when convenient - which means he might appear in the Admiralty court-martial records.
In that case, ADM 12/27F seems to be an "Index and digest of court martial verdicts", 1812-1855; there are also two "Index and Register of Courts Martial", ADM 13/103 (1803-1856) and ADM 13/104 (1812-1856). It seems likely that if court-martialled by the Navy, he would be named in there. Once you've found an index entry, more detailed papers appear to be stored on a monthly basis in ADM 1 - eg/ ADM 1/5429 covers August 1812. But until you know what month it happened, looking in these might not be very productive.
It's worth noting that there were no individual records for ratings in those days; if you knew what ship he deserted from, you could look at its records and see if he's named. But with only a rough date and potentially any ship which called in North America in that timeframe, this is certainly a dead end.