Trying to change smb.conf, but after restarting Samba server, default settings come up again!
Yep. That is the way it works with most of the files in /etc. When you restart the service the default comes back again. Most of the time there are adequate things you can customize with the *.custom files that this is not a problem. When it is a problem the best way to resolve it is don't start the service. At least not from the router UI. Mark the service as disabled, and then start it from a command line. (You can use one of the many script hooks to automate this.) You'll find the smbd server in /usr/sbin/smbd. Although I would highly recommend if you are going the custom config route for this service, go all the way and install entware and use that server instead.
Oh, one really nasty hack you can do is a mount to replace the /etc directory entirely. If you do that to a ext2 fs or such, you can mark files as "chattr +i" to make files immutable. I don't really recommend this, but it is a possible alternative slightly easier than spinning your own custom firmware.