Water heats up because of convection. In the test tube, which is heated from the bottom, the water molecules in the bottom of the test tube absorb heat and become lighter. This causes them to rise up, where they transfer their energy to the colder molecules lying above. Hence, all the molecules get heated up. But, if the test tube is heated from above, the molecules lying at the bottom of the test tube do not heat up. This is because the heated molecules move above and do not heat the water molecules lying below.