Some jurisdictions have a good Samaritan law, where you must help someone in need. I think the last episode of Seinfeld dealt with this, where the crew ended up in prison for allowing someone to suffer while they watched. Generally good Samaritan laws protect people who do help from liability, rather than give a positive duty to help. Finland and Germany are exceptions:
“The Finnish Rescue Act explicitly stipulates a duty to rescue as a "general duty to act" and "engage in rescue activities according to [one's] abilities". The Finnish Rescue Act thus includes a principle of proportionality which requires professionals to extend immediate aid further than laypersons.
The Finnish Criminal Code stipulates
"Section 15 - Neglect of rescue (578/1995) A person who knows that another is in mortal danger or serious danger to his or her health, and does not give or procure such assistance that in view of his or her options and the nature of the situation can reasonably be expected, shall be sentenced for neglect of rescue to a fine or to imprisonment for at most six months."
Germany
In Germany, failure to provide first aid to a person in need is punishable under § 323c of its criminal penal code. However, any help one provides cannot and will not be prosecuted even if it made the situation worse or did not fulfill specific first aid criteria. People are thus encouraged to help in any way possible, even if the attempt is not successful. Moreover, people providing first aid are covered by the German Statutory Accident Insurance in case they suffer injury, losses, or damages.”
https://en.wikipedia.org/wiki/Good_Samaritan_law
https://amp.abc.net.au/article/12597698
“Lawyers for Richard Pusey, the man accused of filming a police officer as she lay dying on a Melbourne freeway, say investigators got "creative" when charging their client with a crime they say does not exist in Australia. On Wednesday, lawyers for Mr Pusey, 42, urged the Melbourne Magistrates' Court to find that the charge of outraging public decency, which has been levelled against their client, is invalid. "There's nothing in our respectful submission about the valid existence of that charge in the state," his barrister, Dermot Dann QC, said. "The fact that someone creative has decided to charge Mr Pusey with this offence [says] nothing about the validity of the charge or whether it's been recognised," Mr Dann said. As both sides continue to thrash out a possible plea deal, a clear sticking point has emerged about whether Mr Pusey committed an obscene or disgusting act by recording Leading Senior Constable Lynette Taylor in her final moments. "Filming a scene is not necessarily an offence at all," Mr Dann said. "It's not just filming the scene, it's the scene that he was filming," Magistrate Donna Bakos said. On April 22, Mr Pusey was pulled over by Leading Senior Constable Lynette Taylor and First Constable Glen Humphris for allegedly driving his Porsche at 149 kilometres per hour on the Eastern Freeway. Moments after two other officers joined them on the scene, a refrigerated truck, driven by Mohinder Singh, veered into the officers, who were killed in the crash. Police allege that instead of rendering assistance, Mr Pusey pulled out his phone and approached Senior Constable Taylor as she was pinned to the truck. In the days and weeks after the incident, the 42-year-old was charged by police with 15 crimes including perverting the course of justice, possessing a drug of dependence, dangerous driving and failing to render assistance. But on Wednesday, Mr Dann said the charge of committing an act outraging public decency was "unusual" and "unrecognisable" in Victoria. "This court could not be satisfied that the common law offence with which he's been charged has been validly laid, or has a valid existence," Mr Dann said. But Crown prosecutor Robyn Harper told the Melbourne Magistrates' Court that the offence Mr Pusey was being accused of did exist under Australian common law. She pointed to six cases prosecuted in Australia where outraging public decency had played a role. "This very court heard the offence of an act outraging public decency on the 8th of August 2014 and imposed a sentence of imprisonment of one month for that charge in that instance," Ms Harper said. "That indicates from the outset that this offence has been dealt with in this jurisdiction on a previous occasion."”
We will have to await the results of the trial to see what the law is on this. Clearly in terms of morality, allowing the officers to die without at least trying to help is disgusting, and indeed, indecent.