It's not even that complicated and you can do it with existing software. You can take the file into something like Audacity, band stop the range surrounding 50 Hz (or 60Hz in the US), and then simply mix in the prerecorded mains sound like you would do any other mixing.
It's not necessary to mix in the frequency domain because mixing in the frequency domain is mathematically equivalent to mixing in the time domain (FFT(x + y) = FFT(x) + FFT(y)).
It's not necessary to mix in the frequency domain because mixing in the frequency domain is mathematically equivalent to mixing in the time domain (FFT(x + y) = FFT(x) + FFT(y)).