Is he having trouble moving around? Have you noticed any muscle loss in the hind legs? I would bring him to the vet Atleast they can provide some pain relief so he can sleep
Oh your poor dog, he must be exhausted.
It is known medically, that for some reason bone pain and deep tendon pain is always worse at night.
It could be that apart from the soft tissue injury, perhaps he has some other injury? Even bone bruising can take weeks to clear up.
It could be that when he lies down it puts pressure on certain areas which are painful.
And then....there is the psychological aspect too. We don't know much about PTSD in dogs, as they can't talk to us about their bad dreams, flashbacks, and emotions. But it is likely or possible that they do get some form of that.
I agree with taking him to the vet; just seeing if there could be any other issue either related to the accident itself, or aside from that.
Pain relief may help. If it does, you have your answer. But some pain medications can be a bit sedative anyway. Discuss that with your vet.
He may only need a short course to click a re-set. Unless he's an old dog at end of life, then a long continual course of pain relief drugs, and/or sleep drugs is maybe not wise.