97,000 emails?
That's A LOT of emails.
I'm going to offer a simplistic approach ("simplistic" answers are about all an old guy like me can come up with), but I believe it should work.
This would apply to one friend (others could use the same approach).
Open Mail.
Choose to create a NEW mailbox.
MAKE SURE this is created in the "on My Mac" area.
Now, open the soon-to-be-deleted IMAP account.
Go to the [on the server] mailbox ("inbox", etc.) in question.
Now select a block of emails. DON'T select all of them.
In Mail.app's "Message" menu, choose "Move To..."
Select the newly-created folder in the "on My Mac" section of Mail.
The selected emails should be copied into the folder.
I believe with IMAP, once the user does this, the emails are then deleted from the server (not sure about that).
It's probably a good idea not to copy TOO MANY emails at once.
Things could get choked up.
Do it in modest-sized blocks, say 200-300 at once.
KEEP WRITTEN NOTES.
It might be useful to create MORE THAN ONE "target folder" in the on My Mac area, depending on what's being copied. Get things sorted out a bit.
Once this is all done, and all the emails are now on "the local Mac", your friend can choose what to do with them.
He/she might then "export" them to a backup/archival drive (which should ALSO be backed up by at least one more drive).
Then, delete them from the "on My Mac" folders, to free up space on the internal drive.
YES, this will be A GOOD AMOUNT of work.
But this will assure that the emails get preserved in a location other than the original email server.
Sometimes one has to do, what one has to do.
No other "easy way" to get around what has to be done.
Having said that...
Did they change "email" providers, or "ISP" providers?
REASON WHY I'm asking:
Some ISP's will let you retain your email address with them EVEN AFTER you discontinue their services.
I found this out after having switched from Frontier (formerly ATT Uverse) to Comcast Cable. I was with Comcast for about 4-5 years, then switched BACK TO Frontier (better rates, "cut the cable", etc.).
I was amazed to find that after FOUR YEARS, my Comcast email address and password STILL WORKED (even though I had not used it much previously).
Before your friends begin a forced rush job to save the emails, they ought to inquire as to when they'll lose email access -- if they lose it at all.
Good luck.