Since the diameters are in the ratio 4 : 5. It follows that their radii are in the ratio 4 : 5.
Let them be 4r and 5r. Let the height be h and H .
∵ Ratio of volumes = [(1/3)π(4r)2h / (1/3)π(5r)2H
= (16h)/(25H)
⇒ h/H = (1/4) x (25/16) = 25/64 = 25: 64.