The problem is that when you say sudo fdupes -r ./backup/ > dupes.txt, fdupes will run as root as you intend, but the > means that your shell will attempt to open the file, and your shell is running as your user so it can’t write there.

Some options:
* redirect to a file in /tmp/ then sudo mv it where you want it
* sudo su then run the command
* sudo fdupes -r ./backup/ | sudo dd of=dupes.txt