Are you able to delete the default.cfg in this path/Retroarch/Saves/MAME/cfg folder?, if so, delete it and try what i suggested again. Configure the inputs in general first and then go immediately to this system and change the inputs there. Hopefully it works.