2030 if lucky. There are 114 Z3 trams. 114 E classes (or their successors) would need to be ordered to make the Z3s completely surplus to Melbourne's needs. If 2 Z classes were replaced with only one E class you would be effectively halving the timetable even though the passenger rate would be up. And then there is the problem of having another 69 A classes, which are even smaller than the Z3s.
Given that the mechanicals are mostly identical between Z3, A and B2 trams (traction motors, bogies, electrical equipment etc.) and the fact that it takes forever for even a single E class to leave Dandenong and enter service in Melbourne, it is fair to say that they will be around for some time. The only fault that a Z (and A) has is the lack of passenger air conditioning, but unfortunately fitting aircon units to nearly 200 trams would be extremely costly for a fleet which might not even exist ten years from now.