I have notice if you change mame.ini manually it will save the changes but if you change it in MAMEUI and exit it will not save it
I have also tested on my laptop which has windows 10 pro with fresh MAMEUI download it from http://www.mameui.info/
I remembered that this problem came on MAMEUI 0.166 and onward MAMEUI 0.165 doesn't has this problem as I tested it just now on the same PC and on my Laptop