I think this is a good question to test if you think like a physicist. One thing physicist do is to analyze a problem by looking at limiting cases. Here there are two interesting cases: one where the angle of the ramp is zero, so that the ramp is actually just a flat level surface, the other is where the ramp becomes almost vertical (I would say the ramp actually being vertical doesn't make sense, but you can still take the limit).
Think about what the trajectory looks like when the angle is zero. Think what the trajectory becomes as you make the ramp more and more vertical. Then it should become clear what the times are in these limiting cases. Now if you trust the formula they gave you, you should have enough information from these two cases to determine the two quantities they want.
You have asked a good question.
…it does not seem to me that the projectile is simple parabola (as in the ground case) that can be "cut" into halves. So, why does this work?
Really it contrasts with the symmetry. But it has nothing to do with symmetry. You will better understand with following graphs.
Here black line indicates the trajectory of the ball and brown line is the inclined plane.
As @John Rennie precisely explained,
....the word "peak" means maximum distance from the plane measured normal to the plane. It does not mean the maximum height measured from the horizontal.
I have marked them as 'A' and 'B' respectively.
If you try graphing this yourself you will realize that distances $a$ and $b$ in the following picture are equal (This property was discovered by Archimedes).*
Since there is no horizontal acceleration, the amounts of time that the ball takes to pass $a$ and $b$ are equal (consider horizontal motion). Eventually you will conclude that that the time of the flight is given by doubling the time to reach the peak(A).
Thus it is not due to symmetry, but because of the special property of intersection of a straight line and a parabola.
Hope this helps.
P.S.: @Fredriksy has also explained the same thing in his answer,
It seems like you are worried that the flight path after you rotate the picture (x-y axes) is NOT a parabola. However this is not actually important for determining the time of flight.
I guess, with this explanation and my graphs you will understand better. Good luck.
*You can find the mathematical proof here.
(Special thanks go to @CiaPan and @Pope)
EDIT:
Can you observe something else interesting? If you consider a projection relative to the horizontal plane, the horizontal plane will also be a chord to the trajectory, which is a parabola. So the observation, 'by doubling the time it takes to reach maximum altitude with respect to the considered plane, flight time is obtained ', can also be interpreted as a result of this special property of intersection, although it obviously seems to be a consequence due to symmetry:-)
Best Answer
Let coordinates be such that x=0 at the beginning of the incline. That is, when the incline height is 0, x=0, and for all x values greater than 0, then incline height is greater than 0.
We also know the coordinates of the max height of the ball, which we will call $(x_{max},y_{max})$.
Let us first find the height of the incline when $x=x_{max}$. To do this we simply use the tan rule.
$\tan\theta = \frac{y_i}{x_{max}}$
I have used $y_i$ to represent the height of the incline when the x-coordinate is $x_{max}$ (the x-position of the ball's max height). Also $\theta$ represents the angle of the incline.
Re-arranging gives,
$y_i = x_{max}\tan\theta$
Now the height difference, $h_d$ between the ball and the incline is therefore:
$h_d = y_{max} - x_{max}\tan\theta$
But this is just the vertical height difference between the ball and the incline. If we want the perpendicular components however, our calculations are not over yet.
By drawing a diagram, a triangle can be formed from the ball's vertical distance from the incline, and the ball's perpendicular distance from the incline. An analysis of the triangle shows that we can work out the perpendicular distance using the cos rule.
$\cos\theta = \frac{D_p}{h_d}$, where I have defined $D_p$ as the perpendicular distance between the ball and the incline.
Re-arranging gives,
$D_p = h_d\cos\theta = (y_{max} - x_{max}\tan\theta)\cos\theta = y_{max}\cos\theta - x_{max}\sin\theta$
Therefore the answer to your question is,
$y_{max}\cos\theta - x_{max}\sin\theta$, where $(x_{max},y_{max})$ is the coordinates of the ball's max height.