I posted a help article that explains how to edit a config file to force Ir-mame2003 MAME games that use trackball or dial control to use the mouse (in this case, Arcade-X Trackball) that may help:
https://retropie.org.uk/forum/topic/15819/setup-retroarch-to-redirect-mame-games-that-use-dial-and-trackball-to-arcade-x-tankstick-trackball
Also, I would avoid using a USB hub. I used a third party case that used a USB hub and trackball on the X-Arcade would not work. When I plugged the mouse into its own USB port on the Raspberry Pi, the Arcade-X trackball started to work. I still had to edit the config file to get other games to work that used a dial controller (Tempest, Kickman, etc.), but pluggin the Arcade-X Trackball USB cable into a USB hub and not directly into a USB port on the Raspberry Pi caused issued.