I am guessing you have more sense than money, but still enough money to replace the bikes if you have to.
Assuming you also have plenty of time on your hands…
Buy a new cassette and chain of the same number of rear cogs as you currently have. And a chain whip, and a socket to fit the cassette to remove it. And another one, until you get the right one. If it was a modern cassette, and you researched diligently on the internet, you might get it right first time. Buy new cables; consider buying new sheaths, if you really want to push the boat out; and a set of cable cutters, for the sheaths. If you don’t buy sheaths, clean the old ones by feeding string into the sheath so that as you draw the cable out, it pulls the string through. Don’t cut the string short, as it is going to come off, and you are going to have to pull it out the way it went in. Maybe you should’ve soaked it in petrol or meths first, as well.
dismantle the derailleurs as far as you can be bothered, and soak them in petrol and scrub them with a nail brush. Your mother would tell you to wear marigold gloves while you are doing this, but then you wouldn’t be able to feel how clean they were. Leave everything to dry in the sun for the afternoon while you enjoy a beer, and come back to it the next morning. Fit back together again as much of it as you can remember, and still find. Put a drop of the heaviest oil you have on the cable sheaths and the end of the cable before you push them through. Fit the new sprocket and chain. Tinker and fettle until everything works fine, or frustration gets the better of you. Lubricate liberally, spin to work the oil in, wipe until there is no visible lubricant, and you’ll be good to go after refreshing your weary brow.
Alternatively, if you have more money than any one of sense, perseverance or spare time, take it to a bike shop that has a pub nearby. They could do that four times faster than you could, and you can kid yourself that they did, even though it took one tenth of the time.