The new reg was probably applied in Narita. The FAA paperwork was likely sent out to them to meet the aircraft from Chicago. For UA pilots to fly it under a UA flight number it would have to be on the UA certificate and to be on the certificate it would be very expedient, if not required, for it to carry a US registration.
In ANC it cleared US customs (although I’m not sure what exactly the process for a leased aircraft being delivered is, perhaps the aircraft and its contents just have to be declared). It had to make a fuel stop anyway, and they were able to get both things out of the way in ANC.