It's possible to fix anything from the sources but I guess the Tomcat version in 22.04 didn't have a corresponding stable Debian version? (vs. the 20.04 version)
Confirmed, the tomcat 9.0.58 in Ubuntu 22.04 is not in bookworm/stable (which is on 9.0.70) or bullseye/oldstable (which is on 9.0.43), and the 9.0.31 in Ubuntu 20.04 is the same as the version in Debian buster.
Ubuntu is merely reusing apt to connect to its own repositories. You could manually install packages from Debian's repositories, but it's probably inadvisable.