You are going to be dealing with various cases depending on the values of $c,d,ab$ and $m.$ I think I can get you part way, but I have not dealt with all the cases.
Given that the objective function and the equation constraint treat
all variables $x_{i}$ identically, we can ignore the requirement
that $x_{1}\le x_{2}\dots\le x_{m}$ and just require that the smallest
(largest) variable be at most (at least) $c$ ($d$). Since permuting
a candidate solution does not affect the objective or constraint,
we can simplify this further to $x_{1}\le c$ and $x_{m}\ge d$, which
(assuming $x$ satisfies the equation constraint) are sufficient to
ensure that the sorted version of $x$ is feasible.
Let $[m]$ denote the index set $\left\{ 1,\dots,m\right\} .$ For
any $S\subseteq[m]$ and any $K>0$ let
$$
g(S,K)=\min\left\{ \sum_{i\in S}\frac{1}{x_{i}}:x>0,\sum_{i\in S}x_{i}=K\right\} .
$$
Using the convexity of the function $\phi(x)=\frac{1}{x}$, we can
show that the minimum occurs at $x_{i}=\frac{K}{\vert S\vert}\ \forall i$
with $g(S,K)=\frac{\vert S\vert^{2}}{K}.$ Thus, in the absence of
the requirements that $x_{1}\le c$ and $x_{m}\ge d$, the solution
to the original problem would be $\hat{x}=\left(\frac{ab}{m},\dots,\frac{ab}{m}\right)$
with value $g([m],ab)=\frac{m^{2}}{ab}.$
Now suppose that $x_{m}$ has been fixed at some value $h$ with $d\le h<ab.$
The best possible solution with $x_{m}=h$ is found by solving for
$g\left([m-1],ab-h\right).$ To avoid division by zero, we need the strict inequality $ab-h-x_{1}>0,$
which we will enforce as $x_{1}\le ab-h-\epsilon$ for some small
positive $\epsilon.$ We can express the reduced problem as
\begin{align*}
\min_{0<x_1\le\gamma} & \frac{1}{x_1}+g\left(\left\{ 2,\dots,m-1\right\} ,ab-h-x_1\right)\\
=\min_{0<x_1\le\gamma} & \frac{1}{x_1}+\frac{(m-2)^{2}}{ab-h-x_1}
\end{align*}
where $\gamma=\min(c,ab-h-\epsilon).$
In the absence of the requirement that $x_{1}\le c,$ we know from
convexity that the optimal solution would be $x_1=\frac{ab-h}{m-1},$
where the partial derivative w.r.t. $x_1$ changes from negative to
positive. So the optimal choice of $x_{1}$ is
$$
x_{1}=\begin{cases}
\frac{ab-h}{m-1} & \gamma\ge\frac{ab-h}{m-1}\\
\gamma & \gamma<\frac{ab-h}{m-1}
\end{cases}
$$
with corresponding objective values
$$
\begin{cases}
\frac{(m-1)^{2}}{ab-h} & \gamma\ge\frac{ab-h}{m-1}\\
\frac{1}{\gamma}+\frac{(m-2)^{2}}{ab-h-\gamma} & \gamma<\frac{ab-h}{m-1}
\end{cases}.
$$
Now you just have to optimize that with respect to the value $h$ for $x_2$, taking into account the requirements that $h\ge d$ and $ab-h > 0.$