I have the same issue, but I have not tried the button in SNES emulator, only Sega Genesis. I have tested Master System and N64 and it is not working.
Is there any file that may be overriding the main one? All my other retroarch.cfg files are empty, I have added that line in /home/pi/RetroPie/configs/all
Edit: After searching for a while, I found this thread. I changed the Master System emulator to PicoDrive and it works, so it seems that some emulators are ignoring the RetroPie/configs/all/retroarch.cfg file.
To change the MS emulator to PicoDrive, change the .emulationstation/es_systems.cfg Master System COMMAND line to the following:
COMMAND=/home/pi/RetroPie/supplementary/runcommand/runcommand.sh 1 "/home/pi/RetroPie/emulators/RetroArch/installdir/bin/retroarch -L /home/pi/RetroPie/emulatorcores/picodrive/picodrive_libretro.so --config /home/pi/RetroPie/configs/all/retroarch.cfg --appendconfig /home/pi/RetroPie/configs/mastersystem/retroarch.cfg %ROM%"