is a similar feature request with more discussion.
Duplicati doesn’t overwrite previous backups when source files change. It makes a new backup version.
Just be sure not to set your retention policy to something super short like only keeping the latest version.
At some point the ransomware might get into Duplicati’s database or temporary files and kill the backup.
This isn’t a big deal as long as the destination files are still around, so don’t backup to easily killed place.