Ugh I'm so sorry
Been there myself many times. Including roadside at night in the rain nearly getting clipped myself trying to help a large doe hit by an asshole who clearly didn't care they left an animal suffering to their death.
What I've learned over the years - especially when despite your efforts, the animal doesn't make it - is this: Every being, whether human or animal, has their own path. It may be different from what we perceive. The best we can do is what we can, with genuine effort for that being
It may have been that what the dog you helped "needed" in his life experience was to know what it felt like to have someone help, care, and try
on his behalf. Soul path complete for this lifetime, perhaps. It's something I felt and saw in her eyes as the doe looked up at me, her head in my lap, as the rain poured down and cars whizzed behind me while waiting for the cops to arrive with their guns.
What happened with the dog may have created a shift in awareness for you or the others involved. These bigger picture things are not without additional "benefit" that way.
It may sound like an out-there concept but when you consider there are larger things at play in the Universe, it's plausible. You were there for a reason.
Just yesterday while at work a baby bird fell from a nest into a horse's stall (horse is one of "my" horses). Not an unusual occurrence this time of year. Eyes not yet open but seemed unharmed. A second one was already dead in the aisle. Anyway, I took the little one to a wildlife rescue minutes away. How could I not? I was there for a reason. It happened in one of my horses' stalls for a reason. A couple of the people from the barn said it was "more than they would do." What? Why. People blow my mind sometimes. But perhaps next time those people might remember there is something they can try to do.
One more thing. Most veterinary offices are closed Sundays but around my area at least there are emergency clinics open always. It might be something to look into in the event you are faced with this again.