The Japanese embassy and consulates in the US only accept applications from residents of the US.
E.g. the NYC consulate: https://www.ny.us.emb-japan.go.jp/itpr_en/visa00.html
> You may apply for a visa at this Consulate if you are currently residing within the area covered by this Consulate.