The hyphenated solution works with one proviso: already-hyphenated names have to pick one of the two.
Jane Doe marries Richard Ray. Children's family name: Doe-Ray. (Or Ray-Doe at their option.)
Alice Meeh marries Bob Fahr. Children's family name: Meeh-Fahr. (Or the reverse again.)
Jeffrey Doe-Ray marries Archibald Meeh-Fahr. Children's family name are, at the option of the parents (though we should probably demand consistency across children in the same family), one of Doe-Meeh, Ray-Fahr, Doe-Fahr, or Ray-Meeh.