The second building is 559.890993211 meters tall, or approximately 559.89 meters tall. While solving this problem, an assumption was made that the bases of both building were level. Now, onto the solving process.
Firstly, draw a diagram with two parallel and vertical line segments representing the first building (known as Building A from now on) and and the taller second building (known as Building B from now on) aligned on one end (the "ground").
Draw a horizontal line segment, preferably dashed for easy illustration, perpendicular from the top of the first building to the second building and label it "a" (the letter is unimportant).
This line splits Building B into two segments. Label the top segment "o" (again, the letter is unimportant).
Label the entire line segment of Building B "x". We're solving for x.
We know that Building A is 200 m tall, so write "200 m" next to that segment and the bottom segment of Building B. Since there is a perpendicular line from the top of the line segment representing Building A that splits the parallel segment representing Building B, we know that the bottom segment of Building B is the same height as Building A.
Label, the angle formed by a and the line segment from the top of Building A to the top of Building B with 40°, as that is that angle of elevation. Label the angle formed by a and the line segment from the top of Building A to the base of Building B with 25° as that is that angle of depression.
Now, if we find the length of a, we can find the length of o and add that to 200 m to find the height of Building B.
To find the length of a, we can use the length of of the bottom segment of Building B (200 m) in the triangle it is a part of (the bottom triangle in the diagram you drew).
tan (25°)=opposite/adjacent=200/a
a=200/tan (25°)
a≈200/0.46630765815≈428.901384102 m
Now that we know the length of a, we can find the length of o.
tan (40°)=opposite/adjacent=o/a≈o/428.901384102
o≈tan (40°)*428.901384102
o≈559.890993211 m
Finally, to find the height of Building B (the second building), x, we need to add o to the height of the bottom segment of Building B (200 m):
o+200≈559.890993211+200≈759.890993211≈759.89
Therefore, the second building is approximately 759.89 meters tall.
P.S.: I also added a picture of a diagram to this answer. Hopefully, it shows up.