Using raspi-config to change the audio output will not write to /boot/config.txt, but will change the ALSA (sound system) settings.
Changing the settings from the raspi-config will invoke
underneath. Try running this command from the command line (exit EmulationStation via the menu or by pressing F4) and see if the settings are kept after a reboot.
If that doesn't work, then add more info about your system, as detailed in https://retropie.org.uk/forum/topic/3/read-this-first.