Short answer, both can still come back via a higher level[or just another additional level] of immortality type 8.
Long answer:
Raphael is implied to have a backup in VoTW/World Language/World System [voice of the world], so it can still function after backing up/restoring itself.
The proof is
here, where even Great Sage[previous version of Raphael] could regenerate Rimuru after his Soul was
evidentially destroyed, which should have destroyed Great Sage itself completely as well. The same
happened at another instance as well, so Raphael, which is Great Sage's evolved version, should be able to do the same, if not even better than Great Sage.
World System is an omnipresent thing that encompasses all of the cosmology, it's basically a
set of type 1 concepts and laws governing the world. So basically, to kill Rimuru's Demon lord key, you'll have to nuke the whole set of type 1 concepts/laws, Rimuru himself, and Raphael as well.
Tho it's mentionable that since Raphael can manipulate information particles to an extent, it should be able to escape an attack that may erase Rimuru at immeasurable speed.