What is the exact model of the iMac and what OS was installed on it before you erased it? You can get the exact model by entering the serial number here (the serial number is on the bottom of the iMac stand):
Check Your Service and Support Coverage - Apple Support
Try booting with Command + Option + R to see if it bypasses the AppleID authentication. Earlier versions of macOS had to be purchased through the App Store and were tied to the original AppleID. In theory using the key combination I listed should allow macOS to be reinstalled without reference to an AppleID. The Apple documentation is lacking details so I'm not certain if this will work.
If you have access to another Mac which is able to run an OS your Mother's old iMac can run, then you can create a bootable macOS USB installer using the instructions in this Apple article:
How to create a bootable installer for macOS - Apple Support
Here is an article which lists which Apple hardware is compatible with which versions of macOS:
https://eshop.macsales.com/guides/Mac_OS_X_Compatibility
Depending on the OS last installed and the OS you are installing, you may have to prepare the drive differently. Having these details I can provide you with a little bit more details on how to proceed if you have problems.