Seems like my solution to this was temporary.
After a reboot the buttons gets mixed up again… So I have the same problem here.
I originally installed the 2.6 SD image. I ran the latest binary update today.
While trying to fix this I deleted all the gamepad config-files in /opt/retropie/configs/all/retroarch-joypads/ and runned the retropie_setup.sh, which generated /opt/retropie/configs/all/retroarch-joypads/USBGamepad.cfg.
I have found out that Retroarch loads /opt/retropie/emulators/retroarch/configs/USBGamepad.cfg instead.
Still the buttons is mixed up. To fix this, I have to enter the menu in Retroarch and correct the buttons (setting x to x, y to y etc. in a Megadrive game). Saving generates a new cfg-file. Loading this file later doesn’t work, since I am unable to get out of the menu.
Any tips would be appreciated :-).