buying Oracle to get them to go away would still leave that on the books for future court cases
Is this really a problem? Buy Oracle, preserve the lawsuit against their new Oracle subsidiary, and then don't let the subsidiary defend its position. It's still a matter of convincing SCOTUS, but without a bunch of pesky arguments from the opposition. Plus they get to punish everyone at Oracle who supported this infringement case.
If I ran Alphabet I'd be tempted. It'd be expensive, though. And very likely couldn't be completed in time.