Visual quality, file size, compression time, decompression time, browser support, toolchain support, patent restrictions. Considering any one of those in isolation is insufficient for evaluating image formats.
Additionally, use cases are critical for understanding which of these and other properties matter, as well as their relative importance. Authoring formats (e.g. Apple ProRes, DNG) are evaluated much differently than distribution formats (e.g. AV1, JPEG).
Edit: According to this table, AVIF does in fact support HDR:
I'm afraid that your first reply misfired a bit if that was what you wanted to get across though.
Otherwise both formats have all features. JPEG XL is yuv444 by default whereas AVIF tends to favor yuv420 and some encoding/decoding hardware is going to be yuv420 only, so with AVIF one would often need to go software coding to get yuv444 quality.