I had an issue like this in MAME awhile back when I was trying to set up the pedals for something (gas registering as always on and then actually slowing the car when I depressed the pedal)
See if this helps; Use the MAME option to configure your controls in-game (the menus you access with the TAB button) and when you get to the option for the gas pedal, fully depress the pedal BEFORE you do anything. Then hit the button to configure it (I think you just press enter off the top of my head) and then release the pedal and hopefully you should see MAME recognise an axis like Y, Z or RZ as you return the pedal to it's 'off' position. Do the same for your brake as well and it should hopefully work for you. This was just with all the wheel options in their default settings, not reversed.