I'm very sure Tex'll have a much better solution than this one, but I figured I'd come back anyway since I said I would. If you try any of this, please save a copy first in case something breaks.
Leaving the body text part alone, since that part seemed ok, I'd try this in that footnotes section. I'd first fix the broken backlink with this regex search:
Find
Code:
(<a class="_idFootnoteAnchor.*?>)(</a>)(.*?)(</p>)
Replace
Basically moving the note contents ahead of the empty <a>, and filling the <a>with a back arrow. Then, to get the numbers back, I'd start with something like:
Find
Code:
<div class="_idFootnotes">
Replace
Code:
<ol class="_idFootnotes">
Find
Code:
</aside>\n</div></body>
Replace
Code:
</aside>\n</ol></body>
That'd change the parent <div> to an <ol>. Note that you'll have to also adjust this in CSS, because InDesign will likely have it in there as div._idFootnotes. If so, you'll have to edit it to ol._idFootnotes, or probably just ._idFootnotes.
After that, I'd do this:
Find
Code:
<aside (id="footnote-\d{1,}")
Replace
Find
Code:
↩</a></p>\n</aside>
Replace
You'll have to go back into the CSS again with that to change aside._idFootnote to li._idFootnote, or just ._idFootnote. I attached the basic result, note that I did not bother setting any CSS up here. Again, I wouldn't do it this way unless you can't find a better solution, and I'm sure there is one.