Without the treaty, would each navy simply build whatever it wanted?
Short answerYes, but every rival would do the same; Japan valued the treaty because it restrained competitors while Japan developed its infrastructure and technology.
NotesWithout a treaty, every navy could build according to its own ambitions. Japan's freedom to expand would therefore come with freedom for its competitors to expand too. The treaty restrained those competing programs while Japan developed its infrastructure and technology. That gave Japan time to invest without simultaneously bearing the costs of an unrestricted naval race.