Given the following context

James asked Robert for a favor but *he* was refused.

Are "James" and "he" the same?
yes