This isn't actually a question, but all the threads I found when looking for an answer were archived, so I'm taking the liberty to just post my own answer in a new thread, so that hopefully it helps someone.
The problem is apparently ROM-independent, but may be Android version-dependent, as some people mentioned downgrading or upgrading as a solution. My ROM is a "Vortex" custom ROM, I believe Android 9.
Anyway, the issue is that selecting 4k for screen resolution in the Android settings will only hold for a period of time — until you either restart the box or it goes into sleep mode and is woken back up. It then reverts to either 1080p, 720p, or 480p apparently — in my case it was simply 1080p60 each time.
There are suggestions to enable "automatically select best screen resolution," but it seems that — like me — if you have this issue, that selector is greyed out.
There are also suggestions to enable HDMI-CEC, which I found odd, as HDMI-CEC AFAIK doesn't have anything to do with negotiating screen resolutions — that's what EDID is for. Unsurprisingly, this didn't have any effect on my box.
What DID work for me was disabling Dolby Vision in the Android settings. I'm not even sure my TV supports Dolby Vision, though I believe it might (it's an old LG B6 OLED). But either way, not only does this fix the automatic undoing of my screen resolution configuration, it also enables me to select the "automatically choose best resolution" setting — but I haven't enabled that — and to enable resolutions above 2160p30. Previously, with the issue existing and Dolby Vision enabled, the max I could select was 30 Hz 4k. I can now select 60 Hz 4k.
So, just to share this finding with any one of you that may be in the same boat, or any one in the future Googlefacing for this problem. Try disabling Dolby Vision and see what happens.
Cheers, Daniel
Thanks for your contribution, hope it helps other people.