I'll place a substantial sidebet that O'Brian found that set of words for "The Battle of the Nile" in some obscure source. He loved to include historical tidbits into what he was writing. You might also pose your query on the Patrick O'Brian website, although traditional ballads are not their strong suit.