The Shulchan Aruch paskens (OC 4:18) that when you go out of a bathroom you need to wash your hands. The Pri Megadim says this applies even if you do not use the facilities or even touch anything with your hands. The question then arises if there is a sink and cup inside the bathroom what good does it do for you to wash your hands in the bathroom if as soon as you leave you need to wash it again?The Chelkas Yaakov (OC 2) explains that washing your hands after using the facilities which is because of cleanliness. Therefore it is assur to say a Bracha until you have washed your hands. However the reason for washing hands for merely being physically present in a bathroom is because of a Ruach Ra’a. Although you must wash Netilas Yadayim to rid yourself of this Ruach Ra’a it is permissible to make a Bracha even if you haven’t done so.
Therefore if you are in a situation where the only place to wash your hands is inside the bathroom you are permitted to use the facilities, wash your hands inside, and then make brachos and even daven afterward. When you have an opportunity to wash outside of the bathroom you must do so to rid yourself of the Ruach Ra’a.