Which mame emulator?
I have close to your same setup, minipac for P1/P2 with real arcade sticks/buttons and two usb xbox style controllers. My issue was with advmame and was that the controllers were already mapped to p1/p2, and when I mapped my minipac to p1/p2 then both were setup on same player. The fix for me at least was to delete the mappings for p1/p2 first and then set minipac to p1/p2 and xbox ones to p3/p4.
If you are using lr-mame-2003 etc not sure if that would be the same problem but worth checking. There are also different roms for 2p vs 4p ones for simpsons and tmnt. Not sure about the other two. I never tried a 2p one, so not even sure it shows 4 players as an option on those.
Thank you for the heads up. I've managed to get this resolved. for my 4 player games I set it to use lr-mame-2003 instead of lr-fbneo. The mame2003 emulator is much easier to work with. Once the game loaded up I pressed tab on the keyboard and then amended the input for the game. I reconfigured the buttons for each player and now it works as expected.
NBA JAM threw me as if you want 2 players to play on opposing teams the joysticks have to be setup as player 1 and 3. Player 2 and 4 are on the usb gamepads as they are the team mates for player 1 and 3.