That can happen. As a musician myself I ripped off unknowingly riffs from at least 3 songs (thankfully one was caught before recording) including one from a band I don’t even like, so yeah. But this theme seems just like an intentional take on a popular period song, which is fine. In the first “Pirates!” game I think all music was lifted from classical composers.
Thankfully it’s old enough that modern copyright laws don’t touch it - public domain!