Now, murder needs a definition because they are all subtly different. Let’s use the one in the new-south-wales Crimes Act 1900:
Murder shall be taken to have been committed where the act of the accused, or thing by him or her omitted to be done, causing the death charged, was done or omitted with reckless indifference to human life, or with intent to kill or inflict grievous bodily harm upon some person, or done in an attempt to commit, or during or immediately after the commission, by the accused, or some accomplice with him or her, of a crime punishable by imprisonment for life or for 25 years.
The only real difficulty is in the phrase “causing the death charged”. So a sensible prosecutor would charge both defendants with both deaths. A jury would find them guilty beyond reasonable doubt of one of the “death[s] charged”.
The case is similar to Rogerson and McNamara who took a live Jamie Gao into a storeroom and came out with a body. Each accused the other of the murder - the jury didn’t believe them.