I restored a rusty chain by cleaning with a wire brush and brilo pad. But if its heavily rusted chances are it won't work as well, even once clean.

Mine took ages to clean and didn't work very well. I couldn't get all the links to run 100% free there was always a bit of stiffness in some of them. It was far easier to pop down to the shop and get a new one

I have just done a heavily rusted 6-speed chain. I just used liberal quantities of WD40 and plenty of up-and-down and side-to-side wiggling to free it up. Then mopped up the WD40 and applied a liberal dose of chain lube. Runs lovely (if not especially cosmetically pleasing).

It's a heavy old chain though, and the rider is not going to be ascending Mont Ventoux with it or owt like that so YMMV depending on the sort of duty you're envisaging.