Is this even possible - is there something like a RELEASE_VERSION environment variable?
The above approach mentioned by Tomaž Zaman will do the job if you have less that 200 releases for your app. Otherwise will not... please refer to Ranges section from Heroku API Documentation:
https://devcenter.heroku.com/articles/platform-api-reference#ranges
You don't need Heroku Labs feature Metadata. This is what you need:
curl --request GET \
--url https://api.heroku.com/apps/{APP_NAME_ID}/releases \
--header 'Accept: application/vnd.heroku+json; version=3' \
--header 'Authorization: Bearer {AUTH_TOKEN}' \
--header 'Range: version;order=desc,max=1'
This will retrieve a list with latest releases (in this case only one, max=1) and what you need to do is to get response[0], that's it.