Perhaps the rat has been poisoned with a chemical that also kills beetles? An interesting addition to our Gallery Of The Macabre.
Many thanks, Keith! - it's from a forest trail and I wouldn't expect that poison is being laid out (to kill e.g. rats) in that area, but you never know if chemicals has been left there. I went back and it turns out the path is used by many runners .. so the beetles were probably crunched and spread while enjoying the carcass.