Let the distance between the two boys be \(d\). We will use trigonometric functions to find this distance.
The height of the temple is \(45 \, \text{m}\), and the angles of elevation are \(30^\circ\) and \(60^\circ\).
Let the distances from the temple to the boys be \(x_1\) and \(x_2\) respectively. Using the tangent function:
\[
\tan(30^\circ) = \frac{45}{x_1} \quad \text{and} \quad \tan(60^\circ) = \frac{45}{x_2}
\]
We know that \(\tan 30^\circ = \frac{1}{\sqrt{3}}\) and \(\tan 60^\circ = \sqrt{3}\). Thus:
\[
\frac{45}{x_1} = \frac{1}{\sqrt{3}} \quad \Rightarrow \quad x_1 = 45\sqrt{3}
\]
\[
\frac{45}{x_2} = \sqrt{3} \quad \Rightarrow \quad x_2 = 15/\sqrt{3}
\]
The total distance between the two boys is:
\[
d = x_1 + x_2 = 45\sqrt{3} + 15/\sqrt{3} = 40\sqrt{3} \, \text{m}
\]
Thus, the correct answer is option (2).