I figured it out, or at least why it wasn't working in Tempest or Centipede. Having it work in Marble Madness threw me off by making me think that the correct mouse index was already set. It was not. My trackball is at mouse1.
In the main retroarch.cfg I set:
input_player1_mouse_index = "1"
That fixed it.