You don't want to use ls, you want to use shell globbing and string manipulation:
$ for f in *.rej; do size=$(stat --printf "%s" "${f%.rej}.failed") && if [ $(stat --printf "%s" "$f") -eq "$size" ]; then mv "${f%.rej}.failed" backup/; fi; done 2>/dev/null
Explanation
The stat --printf "%s" command will print the size a file in bytes. ${f%.rej}.failed will print whatever the name of the current .rej file is but with the .failed instead of the .rej extension. If that file exists, then size=$() will exit correctly and the script will continue (&&). So, if the $size of the .failed file is the same as the size of the .rej file, then the .failed file will be moved to the directory backup/.
.failedextension. Please see my updated answer for a solution that takes size into account.