You could have enabled mame's -multimouse, thus giving each mouse device a different number, and left the tt2 on the X axis. Then remapped inputs general so the TB got mapped to mouse #Q (whatever number the U-trak is) and the dial to mouse #N (whatever the tt2 is).
Moving the tt2 to the Z axis meant you had to remap anyway. But since you got it working, not worth it to redo it. But you might want to think about it next time you upgrade mame.
option 1:
put tt2 on Z aixs
recompile Z axis hack
remap dials to use Z axis
(optional) save remap in ctrlr file
option 2
put tt2 on X axis
enable mame's -multimouse option
remap dial to use correct mouse # (assuming tt2 is not mouse 1)
remap TB to use correct mouse # (assuming U-Tark is not mouse 1)
(optional) save remap in ctrlr file
Each has it's own pluses and minuses.