I think it's different to the trolley problem in terms of trying to measure the outcome.
If we make decisions based on what will have the best outcome, well the trolley problem is trivial; minimise the negative outcome.
In the scenario of murder for the cancer cure, you're still left with someone who was murdered. My take is that this isn't any less bad than someone who was murdered for something other than the cure for cancer, which in turn means I would stop this murder even if it meant not curing cancer.
If we make decisions based on what will have the best outcome, well the trolley problem is trivial; minimise the negative outcome.
In the scenario of murder for the cancer cure, you're still left with someone who was murdered. My take is that this isn't any less bad than someone who was murdered for something other than the cure for cancer, which in turn means I would stop this murder even if it meant not curing cancer.