There are three different versions of the Z64, called HW1/2/3(HW stands for hardware) or V1/2/3(V for version). The first one only had 16MB of ram, the other two had 32MB.
You can't upgrade a V1 to 32MB nor a V1/2/3 to 64MB ram.