The problem formulation requires that it starts from rest, the curve tangent is parallel to y-axis. All of potential energy is converted into kinetic energy. Since we consider energy and conversion involves velocity as kinetic energy and potential energy as the vertical displacement, acceleration does not enter into a definitive formulation at all.
$$ mgy = \frac12 m v^2\rightarrow v=\sqrt{2 g y} $$
For minimum time taken
$$t_2-t_1 = \int dt = \int \frac{ds}{v}=\int \frac{\sqrt{1+ y^{'2}}dx}{\sqrt{2 g y}}$$
$$F(y(x))= \int \frac{\sqrt{1+ y^{'2}}dx}{\sqrt{ y}}$$
Euler Lagrange $ F_y-y'\dfrac{\partial F }{\partial y^{'} }=const. $ results in ODE of the cycloid as :
$$ \dfrac{ yy^{''}}{1+y^{'2}}= \frac12$$
which is independent of acceleration due to gravity $g$ as long as it is constant. The constant of cycloid size is an arbitrary constant $2a$, which is the radius of imaginary rolling circle.
From vertical energy conservation again we have from rest to minimal position (zero vertical velocity component)
$$ 2a = \frac12 g T^2 \rightarrow T=\sqrt{ \dfrac{4a}{g}} $$
and only $ \sqrt{ \dfrac{2y}{g}} $ at intermediate points. It depends on how big a cycloid you wish to build.
Since size is arbitrary and when we fix its size, its time to descent to lowest point also gets fixed as above.. making the time to slide to its lowest point from any starting point at rest also fixed... marking the tautochrone property of a cycloid.
The answer depends upon the distance $d$.
First, recall that the brachistochrone is a cycloid, the curve traced by a point on a circle rolling along the directrix (dashed line, figures below), which is at the height of zero kinetic energy of the particle. Thus if the particle starts at rest (as it does in this problem), the directrix is at the height of $A$ above the "floor," denoted $h$. The radius of the circle depends upon the locations of the initial and final points.
If $d$ is small ($d < \pi h/2$... half the circumference of a circle that remains above the "floor"), then a single cycloid (brachistochrone) can go from $A$ to $B$ without needing to go through the floor and hence (as the Bernoulli brothers proved) is the optimal solution.
If $d$ is so large that a cycloid would have to pass "beneath the floor" (as the poser posits, i.e., $d>\pi h/2$), the solution is to take the cycloid that is tangent to the farthest possible point on the floor (the point at $(\pi h/2,0)$), then follow the floor to $(d,0)$.
To see this: Note that the brachistochrone is, by definition, the fastest route to $(\pi h/2,0)$. By the properties of a brachistochrone, it does not speed up the route to $(\pi h/2, 0)$ to get to the floor "sooner." Clearly, too, the floor is the fastest route from $(\pi h/2,0)$ to $(d,0)$ because the particle has the fastest possible speed (given the constraints) and also the fastest horizontal speed. Note that the optimal curve is continuous throughout because the cycloid has vanishing derivative at the transition point... the same as the horizontal "floor."
For any point $B$ beyond $\pi h/2$, the unconstrained brachistochrone would have to go "beneath" the "floor," and is hence unacceptable.
Closely related reference.
Best Answer
A brachistochrone always includes the cusp of the cycloid (not surprisingly, since the tangent becomes vertical there and this is the fastest way to accelerate initially), whereas the tautochrone always includes the minimum point (it is not isochronous to any other point, as can be seen by examining the integral for the descent time given on MathWorld with a more general angle than $\pi$).
Therefore only the totality of the first descending arc is both a brachistochrone between its endpoints and a tautochrone to its bottom endpoint. Such a cycloid exists joining $(x_1,y_1)$ to $(x_2,y_2)$ when $\frac{x_2-x_1}{y_1-y_2} = \frac{\pi}{2}$, as may be seen by examining the parametric equations $\frac{1}{2}k^2(\theta-\sin{\theta},\cos{\theta}-1)$. Any brachistochrone that contains a minimum is a tautochrone to its minimum (from either side, of course). On the other hand, any tautochrone that contains a cusp is a brachistochrone from that cusp to any other point on it.