You are able to save core overrides for main settings like vsync or which device is p1, p2, etc., then save core and/or game remaps etc. for button assignments. Although if you tend to connect/disconnect your controllers it may (I can't say for sure, I just had that issue with my DS4 which is used as an Xbox controller with DS4Windows but at times is recognized as a duplicate DS4 as well after apps like Windows Store refresh the controller or if I get a power cut or if my controller disconnects while playing or similar, and that changes the order of the device id as I have more connected) make it so each is assigned differently every time, but that's easy to check and the remap should stay intact still so once you switch the device to the right one for the core/game you play it should work as before. I use a Fighting Commander for FBNeo, Saturn, Genesis emulation and the DS4 for GBC, SNES, PS1, N64, Dreamcast, PSP, etc. (as well as specific games in the other cores that do use analog controls like racing and super scaler games, or Virtual On for Saturn for the Twin Stick, I also set the Fighting Commander for some Dreamcast fighting games etc.) and have no major issues. You learn it and get used to it.
Basically you go to input settings in RA and set your devices there and that's what all cores should use if it's not changed (maybe quit to ensure it applied and saved it before changing things again, I also usually disable all player devices past 2 and change it to max 2 players, just in case). Then you load a game of the core you want a different controller for, open the quick menu, go back to the main RA settings, change the input devices to what you want for that core if it's different to your default, go back to the quick menu, overrides, save core override (then again maybe quit to ensure it's all saved and applied). Then upon starting RA the devices should be set to the default yet upon loading any game with that core, it should be using the override's set devices. Similarly you can do a game override. Then in the quick menu you go to the control options to actually assign buttons, ie, my Fighting Commander's R1 and R2 are placed where the Saturn Z and C buttons are so I set those there etc., again you can save different remaps for the whole core, or per game (and also change the device it emulates, like standard controller, wheel, twin stick or whatever that console had available and the core supports).