The HOA foreclosure will not relieve you of the mortgage debt. Until you complete a transfer of title - you're still on the hook.
Legal disclaimer: This is not legal advice and is not intended to create an attorney-client relationship. The post is only an opinion. You should speak to an attorney for further information. The poster is licensed only in Illinois. Please visit www.bernardjconway.com for more information about our services. If this post is useful to you, please remember to upvote it.
If the HOA takes title, then the HOA becomes responsible for paying the mortgage. If you allow the HOA to foreclose, it will already appear negatively on your credit report.