Just type “## References
” as last line
This method, unlike previously provided solution, inherits ability to be linkable, as well as leaves possibility to choose the content of the title by users liking (other than References or in another language than English).
Unfortunately this introduces another problem:
Double horizontal lines.
Previously provided solution wouldn’t exactly solve this either, it simply displays title below the final ruler, instead above it (I think it bit more aesthetic).
I'd solve this with conditional rule, so that the program simply remove -- or at least hide -- the horizontal ruler above the footnotes section, in case if last line of the document is header.
Perhaps, also limiting to level 1 and 2 header only, even more so, as since third and lower levels do not have underlines.
Personally, I’ve met this as issue as well, often ending to manually edit exported document as needed (if possible). But also mine need for this title to lack, has been way more frequent.