Let $X,$ $Y$ and $Z$ be exponentially distributed with $E[X] = 1/\lambda_X$, $E[Y] = 1/\lambda_Y$, $E[Z] = 1/\lambda_Z$ respectively.
How do I calculate $P(X > \max\{Y,Z\})$?
I have A, B, C and D for 3 cash boxes in a queueing system. Consider D the one waiting. I want to find the probability D is the last one to leave. The service times of the C.Boxes are indep. Exp with mean 5 (same mean for c.box 1, 2 and 3) That's how I'm trying to solve this: P(D last one) = P(T1 > max{T2,T3})*P(T1 < min{T2,T3}) + P(T2 > max{T1,T3})*P(T2 < min{T1,T3}) + P(T3 > max{T1,T2})*P(T3 < min{T1,T2})
And then: $$(\frac{1/5}{1/5+1/5})^4+(\frac{1/5}{1/5+1/5})^4+(\frac{1/5}{1/5+1/5})^4 = = 3(\frac{1}{2})^4 = 3\frac{1}{16} = \frac{3}{16}$$
The beginning of this answer addresses the original question of finding $P(X > \max\{Y, Z\})$. OP added more context to the question afterward; I address that at the end of this answer.
[Assuming independence of $X,Y,Z$.]
Note that $P(X > \max\{Y, Z\}) = P(X > Y> Z) + P(X > Z > Y)$.
\begin{align} P(X>Y>Z) &= \int_0^\infty \lambda_Z e^{-\lambda_Z z}\int_z^\infty \lambda_Y e^{-\lambda_Y y}\int _y^\infty \lambda_X e^{-\lambda_X x} \, dx \, dy \, dz \\ &= \int_0^\infty \lambda_Z e^{-\lambda_Z z}\int_z^\infty \lambda_Y e^{-\lambda_Y y} e^{-\lambda_X y} \, dy \, dz \\ &= \int_0^\infty \lambda_Z e^{-\lambda_Z z} \frac{\lambda_Y}{\lambda_X+ \lambda_Y} e^{-(\lambda_X + \lambda_Y) z}\, dz \\ &= \frac{\lambda_Y}{\lambda_X + \lambda_Y} \cdot \frac{\lambda_Z}{\lambda_X + \lambda_Y + \lambda_Z}. \end{align} The other term $P(X>Z>Y)$ can be computed similarly.
Verification with BruceET's simulation: $$\frac{\lambda_Y}{\lambda_X + \lambda_Y} \cdot \frac{\lambda_Z}{\lambda_X + \lambda_Y + \lambda_Z} + \frac{\lambda_Z}{\lambda_X + \lambda_Z} \cdot \frac{\lambda_Y}{\lambda_X + \lambda_Y + \lambda_Z} = \frac{1/3}{7/12} \frac{1/2}{13/12} + \frac{1/2}{3/4} \frac{1/3}{13/12}=\frac{128}{273} \approx 0.46886$$
Afterthought:
After looking at the expression for $P(X>Y>Z)$ and noting that $\min\{X,Y\} \sim \text{Exponential}(\lambda_X + \lambda_Y)$, one might be tempted to do the following:
\begin{align} P(X>Y>Z) &= P(Y<X) P(Z < \min\{X,Y\} \mid Y<X) \\ &\overset{?}{=} P(Y<X) P(Z < \min\{X,Y\}) \\ &= \frac{\lambda_Y}{\lambda_X + \lambda_Y} \cdot \frac{\lambda_Z}{\lambda_X + \lambda_Y + \lambda_Z}. \end{align} However, verifying the step marked "?" takes some care. In general, the distribution of $\min\{X,Y\}$ does depend on the event $X<Y$, but in the special case of independent exponential random variables, $\min\{X,Y\}$ does not depend on this event. This can be verified explicitly with integrals as follows. $$P(\min\{X,Y\} > t \mid Y<X) = \frac{P(X>Y>t)}{P(X>Y)} = \frac{\frac{\lambda_Y}{\lambda_X+\lambda_Y} e^{-(\lambda_X + \lambda_Y) t}}{\frac{\lambda_Y}{\lambda_X+\lambda_Y}} = e^{-(\lambda_X + \lambda_Y) t} = P(\min\{X,Y\}>t)$$ (I think one could alternatively justify this with a memorylessness argument.)
Update after OP added context:
Stacker's simulations suggest that the answer to the original question "When is D the last to leave?" is $1/3$. Your work almost gets you there except you plug in the wrong numbers. You can use the above result to show that $P(T_1 > \max\{T_2, T_3\}) = \frac{1}{3}$. The other term $P(T_1 < \min\{T_2, T_3\})$ is also $1/3$ if you note that $\min\{T_2, T_3\}$ is exponential with mean $5/2$.
But because $T_1,T_2,T_3$ are identically distributed, you can use symmetry to immediately note that both of these are $1/3$: each of the three boxes is equally likely to end first or end last. So you can skip the complexity of the subproblem of computing $P(X > \max \{Y,Z\})$ altogether.
Plugging in $1/3$ into each term in your expression gives $\frac{1}{3} \cdot \frac{1}{3} + \frac{1}{3} \cdot \frac{1}{3} + \frac{1}{3} \cdot \frac{1}{3} = \frac{1}{3}$ which matches Stacker's simulations.
Also, arriving at the $P(T_1 > \max\{T_2, T_3\}) P(T_1 < \min\{T_2, T_3\}) + \cdots$ expression in your attempt involves a memorylessness argument that should not be glossed over (i.e., given A finishes first, the additional time B needs to finish is also exponential with the same mean, etc.), but I'll give you the benefit of the doubt.