Both configs are correct. Your new configuration has axis for the directional buttons, most likely you've configured the joystick as a D-Pad this time ? EmulationStation should work with both D-pad and Joysticks.

As for MAME2003, what game are you trying out ? It may be that the same has no analog controls and thus it expects digital (i.e. D-pad) controls. You can play with RetroArch's settings for this - in the Controls section of the RGUI, you can switch the P1 device type to RetroPad w/ Analog and change the User 1 Analog to Digital to either Left Analog or Right Analog, depending on how you mapped your joystick in MAME.