From what I see, Egg has the 4 control buttons mapped like this:
1 (RetroPad Dpad-Up) 3 (RetroPad B)
2 (RetroPad Dpad-Up) 4 (RetroPad X)
To re-map them to other buttons, you need to have to have something like this in the system's retroarch.cfg
input_remapping_directory = "/opt/retropie/configs/gameandwatch/"
input_player1_up = "w"
input_player1_down = "a"
input_player1_b = "s"
input_player1_x = "d"
#include "/opt/retropie/configs/all/retroarch.cfg"
In the example above, I remapped all buttons to WASD on the keyboard and it seems to work fine. I think RetroPad L (left shoulder) and RetroPad R (right shoulder) are used for the Game A/Game B selection, if you wish to remap those.
Since this is a specific game config, you can add the input_... options in a special ROMNAME.cfg file next to the .mgw file and the input configuration will be automatically applied, only for that ROM - see https://retropie.org.uk/docs/RetroArch-Configuration/#example-per-rom-override-retroarchcfg.