How to determine the actual or "true" resolution of a digital photo?

Assuming accurate metadata (EXIF) is present, it would be possible to determine possible camera model resolutions.

Without metadata, it is a statistical estimate of the current available possibilities.

What you call "true resolution" is a difficult concept. For starters, digital cameras do not have pixels in the first place, they have sensors. The sensors are in turn processed to produce pixels, but many sensors produce a pixel and a sensor is one of many pixels.

There are image analysis and forensics tools for determining items such as changes, clones, recompressions, resizes, and other changes. Sometimes JPG cosine compression tables or noise models can strongly indicate a particular camera.

In general, unless you can establish the camera model, I do not think you can get what you want realistically.