2 point perspective describes a situation where there is no convergence in the z axis (This occurs in only on the horizon, but its close enough for visuals most of the time.)
That handy fact is what solves our problem. The two cubes share the z axis. We can use a one point projection system to compare height to distance from the horizon. I am assuming that you have the following things figured out :
First cube (vanishing points on the horizon, location of the cube relative to the horizon, I find height very tricky to link to width & length in 2 point perspective I usually steal it from a 3 point perspective.)
Second cube (Vanishing points, location relative to the horizon.)
To solve the height of the second cube, draw rays from a vanishing point through the top and bottom corners of the first cube. Place your second cube, draw a line parallel to the horizon through one of the corners of the cube & intersecting the rays to the vanishing point. Without taking your pen from the paper, draw a vertical to intersect with the other ray, draw a horizontal line back to the second cube. Now close the rectangle by drawing in the vertical height of that part of the second cube.