There is a wgCurRevisionId field currently, which as noted on the doc page is, "The top revision ID of the currently viewed page at the time the page was served"
This is implemented with OutputPage->getWikiPage()->getLatest() (page_latest).
However, in some cases, it is necessary to have the effective revision id. For a simple historical version (oldid=123), this would be the displayed version. For a diff (oldid=123&diff=next, oldid=123&diff=987, etc.), if would be the revision denoted by the diff. This should be available as wgRevisionId.