Wow, the solution just blew my mind! You are absolutely correct about monte-carlo. First consider the Am-Gm-Hm inequality, we have
$$\frac{n}{\sum_{i=1}^{n}\frac{1}{a_i}}\le \frac{\sum_{i=1}^{n}a_i}{n} \Rightarrow \sum_{i=1}^{n}\frac{1}{a_i} \ge \frac{n^2}{\sum_{i=1}^{n}a_i} = \frac{n^2}{2m}$$
With equality iff $\forall i,j: a_i=a_j=\frac{2m}{n}$ and you get the same result if you write Lagrangian and KKT conditions. But this is correct if the problem is unconstrained, while we have $a_1\le m\le a_n$, therefore we must treat $m$ like an optimization variable. The inequality constraints $a_1\le m \le a_n$ can be written as $-m\le -a_1,\cdots, m\le a_n$ which can be written as $I_i(m-a_1)\le 0$ where $I_i=\pm1$ is some indicator function that governs the sign of inequalities. Therefore in our case the Lagrangian is
$$\mathcal{L} (a_1,\cdots,a_n,m,\nu,\lambda_1\cdots,\lambda_n) = \sum_{i=1}^{n}\frac{1}{a_i} + \nu \left( \sum_{i=1}^{n}a_i -2m \right) + \sum_{i=1}^{n} I_i\lambda_i(m-a_i)$$
and the KKT conditions become
$$\begin{align}
&\frac{\partial \mathcal{L}}{\partial a_i} =0 \Rightarrow \frac{-1}{a_i^2}+\nu-I_i\lambda_i=0 \\
& \frac{\partial \mathcal{L}}{\partial m} = -2\nu + \sum_{i=1}^{n} I_i\lambda_i = 0\\
&\forall i: \lambda_i(m-a_i)=0 \\
&\nu \left( \sum_{i=1}^{n}a_i -2m \right)=0
\end{align}$$
We know that $\nu \neq 0$ since $\nu \left( \sum_{i=1}^{n}a_i -2m \right)=0$ and $\sum_{i=1}^{n}a_i = 2m $, this means at least one of $\lambda_i$ is non-zero through equation $\frac{\partial \mathcal{L}}{\partial m} = -2\nu + \sum_{i=1}^{n} I_i\lambda_i = 0$. Assume $\lambda_j\neq 0$ which in combination with $\lambda_i(m-a_j)=0 $ results in $a_j=m$. This means $\sum_{i=1,i\neq j}^{n}a_i=m$ and since $\forall i: a_i \ge 0$, this means $m\ge 0$ and no other $a_i$ is equal to $m$, or there is exactly two $a_i$'s which are equal to $m$. In the latter case, let's call them $a_j=m,a_k=m$.
The first case results in $a_j=m$ and the unconstrained problem (which we solved at the beginning using AM-HM inequality) $\sum_{i=1,i\neq j}^{n}\frac{1}{a_i}$ subject to $\sum_{i=1,i\neq j}^{n}a_i=m$ and $a_j=m$ which has minimum $\frac{(n-1)^2}{m}+\frac{1}{m}$, or the second case where $a_j=a_k=m$ and rest of $a_i=0$ which has minimum $\frac{2}{m}$ but since $\forall i: a_i > 0$ only the first case is acceptable.
I forgot to mention, the problem is obviously convex, so KKT conditions are necessary and sufficient to find global optimum.
It is obvious because all the constraints are linear and the objective is sum of functions of the form $f(x_i)=\frac{1}{x_i}$. Consider each $f(x_i)$ individually, the hessian is $f''(x_i) = \frac{1}{x_i^3}$ which in the non-negative orthant, is convex. Now the main objective is positive sum of individual convex functions $\sum_{i=1}^{N}f(x_i)$ which is convex itself since positive summation (and more general case, expectation) conserves convexity. Unfortunately there is no easier way, you should always check convexity through Hessian, definition or composition rules.