Not sure of your depth of Mame knowledge here, but I'm guessing you are aware of how to configure the controls in Mame.
Load up your game and press the TAB key, go to 'Configure This Game',the second choice down, and find 'Analog X' and 'Analog Y'. Press ENTER on Analog X and spin the trackball horizontally. It should re-populate with your trackball, like 'mouse 3' or whatever it is. Then press ENTER on Analog Y and spin the trackball vertically.
If that doesn't do it, you may have to use a different version of Mame. If you need a better version of Mame, PM me and I'll do my best to hook you up! Hope that helps.
If anyone wants to add to this info, please do!