What version mame are you using? If it's a recent version, did you enable -multimouse option? You don't need to if you're not planning on using the TB & mouse to control different players, and don't mind that moving the mouse will effect games when using the TB.
If it's a little older, before -multimouse setting was added but after mame switched to RawInput, basically -multimouse is forced enabled.
If you want -multimouse enabled or it's forced on you, what's happening is the mouse is the first mouse, and the TB probably the second. You'll need to remap with tab input menu. Remap the TB analog axes by tab, select "Input (general)", player 1, scroll to Track X analog, enter, spin TB sideways, wait and hope mame sees mouse # X (and not mouse # X mouse # Y). Repeat with track Y analog. Do NOT do the inc or dec lines.