when you remap the controls in the GUI it should start working? is it that your ‘insert coin’ button (usually select) isn’t working, so you can’t actually get control of the games in the first place?
anyway, if you do need to remap to get it working, the default save-as config file name (libretro.cfg) is not the one it uses. it should be named retroarch.cfg
so, you can either go into /opt/retropie/configs/mame-mame4all/ and rename libretro.cfg to retroarch.cfg,
or, you can go into /opt/retropie/configs/all/retroarch.cfg and change the ‘save config on exit’ (forget what it’s called) option to ‘true’, and then remap again (don’t need to save – just exit the emulator and it will save in your existing mame-mame4all/retroarch.cfg)