Forget about the power line at first and try to characterize the flight of the ball. You are right in that the ball will be accellerating downwards at 9.8 m/s2 the entire time it is in the air.
Since you are apparently allowed to ignore air resistance, you should be able to see that the time from throw to top is the same as the time from top to catch, and that it would pass the power line the same time difference before and after it reaches the top. Put another way, it reaches the top half way in time between passing the power line on the way up and down.
From this you can easily find the time at top, which is the time from throw to top. From the accelleration over that time, you can find the initial vertical speed. From the initial speed you can find the height at the top. From the start speed, accelleration, and time to pass the power line on the way up, you know the speed at the time it passed the power line. From that you can calculate the average speed from throw to first power line crossing, from which you can find the height.
Let me first go through this without friction or air drag.
You say $v_y$ along the $x$-axis and the train moves with $v_x$ along the $z$-axis. This is a little inconsistent. I will use the velocities, but not your description of the axes. So the train moves in the $x$-direction, the ball is thrown into the $y$-direction and it the $z$-direction is up-down.
From the train
From the observer in the train, the ball will move with a constant $v_y$ away from the train. There is nothing that slows it down. Also, there is no $v_x$ component in the motion of the ball relative to the train. So the man on the train will see the ball right in front of him, flying further away and starting to fall down with $v_z = - g t$. There will be a curved trajectory, a parabola in the $y$-$z$-plane, the plane where the train is moving perpendicularly to.
That looks like this:
You can write this with vectors like so, with $g$ being the acceleration due to gravity:
$$ \vec v(t) = v_y \, \hat y - g t \, \hat z = \begin{pmatrix} 0 \\ v_y \\ - gt \end{pmatrix} $$
Then you can integrate this again with respect to $t$ and get the position $\vec r$ of your ball. I set all integration constants to 0 to make this simpler. In principle, they allow for any starting point. I'll just assume that the starting point is the origin of the coordinate system. So the trajectory is:
$$ \vec r(t) = v_y t \, \hat y - \frac12 g t^2 \, \hat z = \begin{pmatrix} 0 \\ v_y t \\ - 0.5 gt^2 \end{pmatrix} $$
From the ground
If you are an observer such that the train is moving with respect to you, you will see the ball moving with a constant velocity in $x$ and $y$, but also seeing it start to fall down. So you see a parabola in a plane that is crosswise to the axes.
I made another picture, you are looking at the front of the train, just a little skewed to see the 3D axes:
The velocities are similar, except that you have to include the motion of the train as well. The ball has the same $v_x$ as the train has. So this is
$$ \vec v(t) = v_x \, \hat x + v_y \, \hat y - g t \, \hat z = \begin{pmatrix} v_x \\ v_y \\ - gt \end{pmatrix} $$
After integration, this is:
$$ \vec r(t) = v_x t \, \hat x + v_y t \, \hat y - \frac12 g t^2 \, \hat z = \begin{pmatrix} v_x t \\ v_y t \\ - 0.5 gt^2 \end{pmatrix} $$
Galilei transformation
Alternatively, you could apply a Galilei transformation to it. I will try to be pedantic since transformations from coordinate systems are hard to get right. I just have done months of general relativity, so I know how hard this is :-)
Let the system of the train be system $\Sigma$ where the coordinates are $\vec r$ and $\vec v$. The system on the ground shall be $\tilde \Sigma$ where the coordinates are $\tilde{\vec r}$ and $\tilde{\vec v}$.
So we already had the following for the train (without $\tilde{}$):
$$ \vec r(t) = v_y t \, \hat y - \frac12 g t^2 \, \hat z = \begin{pmatrix} 0 \\ v_y t \\ - 0.5 gt^2 \end{pmatrix} $$
Now the transformation from the train to the ground goes like the following:
$v_x \to \tilde v_x = v_x + v_\text{Train}$. All other velocities are unchanged. When this is integrated, the space points will be transformed with $r_x \to \tilde r_x = r_x + v_\text{Train} t$.
With that transformation, we can get the trajectory viewed from $\tilde\Sigma$, the ground:
$$ \tilde{\vec r}(t) = \underbrace{\begin{pmatrix} 0 \\ v_y t \\ - 0.5 gt^2 \end{pmatrix}}_{\vec r(t)} + \begin{pmatrix} v_\text{Train} t \\ 0 \\ 0 \end{pmatrix} $$
You said that the train was moving with $v_x$, so we can write $v_\text{Train} = v_x$ and get
$$ \tilde{\vec r}(t) = \underbrace{\begin{pmatrix} 0 \\ v_y t \\ - 0.5 gt^2 \end{pmatrix}}_{\vec r(t)} + \begin{pmatrix} v_x t \\ 0 \\ 0 \end{pmatrix} = \begin{pmatrix} v_x t \\ v_y t \\ - 0.5 gt^2 \end{pmatrix} $$
which we had earlier already.
Air drag
Air drag will cause the ball to slow down in each of its velocities, bending the curve even more.
Picture from above
If you look from above, this is the same as ignoring gravity. It looks like this:
Time snapshots
When you are in the train, you will see the rails moving below you, and the ball will just move in your $y$-direction:
When you are outside, you will see the train moving. The ball will always be in front of the person who threw it. Therefore it will move on a diagonal line. That line is straight, however!
Best Answer
If the train is moving in a straight line at an unchanging speed, say 30 kilometers per hour, then everything inside the train is moving with it, all of the physics inside the train will work the same as if the train were not moving. The table, the ball, and you, if you are standing still in the train, are all going the same speed and direction as the train. So if you sit the ball on the table, it will not move. Now if the train accelerates to 40 kilometers per hour straight forwards, then the ball will seem to move straight backwards, as the train has accelerated. This is the same effect you feel pushing you back into a car seat when it accelerates forward quickly. If the train decelerates to 20 kilometers per hour, the ball will seem to roll forwards, just as you would feel a forward pull when slowing a car quickly. If the train turns left, the ball will seem to roll right, if the train turns right, the ball seems to roll left. Just as you feel pushed right or left in a turning car. This is due to the ball's inertia and to Newton's first law of motion. See; https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion