Probability of $X > \max\{Y,Z\}$ exponentials 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}$$
 A: Comment:. When you get your general answer, you can compare
it with specific results, approximated by
simulation, for the case: $\lambda_x = 1/4, \lambda_y = 1/3, \lambda_z = 1/2.$
set.seed(213)
x = rexp(10^6, 1/4)
y = rexp(10^6, 1/3)
z = rexp(10^6, 1/2)
w = pmax(y,z)
mean(x > w)
[1] 0.469116
mean((x > y) & (x > z))
[1] 0.469116

A: 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.
A: Simulation
Here is a simulation in R that you can use to see if D is the last to leave given that there are 3 people ahead of him. You can set the rate parameters for the three boxes using rat1, rat2, rat3 for the three boxes. Here I have used 1/5, 1/5, 1/5 as you stated in the problem description.
nit=10000
rat1=1/5
rat2=1/5
rat3=1/5
a=rexp(nit, rat1)
ad=a+rexp(nit, rat1)
b=rexp(nit, rat2)
bd=b+rexp(nit, rat2)
c=rexp(nit, rat3)
cd=c+rexp(nit, rat3)
coun=0
for (i in 1:nit) {
  # a is the first to leave & d is last to leave
  if (((a[i]<min(b[i],c[i])) & ad[i]>(max(b[i], c[i]))) | ((b[i]<min(a[i],c[i])) & bd[i]>(max(a[i], c[i]))) | ((c[i]<min(a[i],b[i])) & cd[i]>(max(a[i], b[i])))) {
    coun=coun+1
  }
}
print(coun/nit)

There's about a 33%-34% chance that D is the last one to leave.
-out
0.3363
0.3431
0.339

Calculation
We want to find $P(\infty>D+A>C>B>A>0)$ and then multiply this by 6 (switching the order of B and C and then allowing B or C to be the first one to finish etc.). These limits can be expressed as $A>0,B>A,C>B,D>C-A$. We directly compute the integral
$$\begin{split}\int_{0}^{\infty}\frac{e^{-\frac a 5}} 5 \int_{a}^{\infty}\frac{e^{-\frac b 5}} 5\int_{b}^{\infty}\frac{e^{-\frac c 5}} 5\int_{c-a}^{\infty}\frac{e^{-\frac d 5}} 5\text{dd dc db da}
&=\int_{0}^{\infty}\frac{e^{-\frac a 5}} 5 \int_{a}^{\infty}\frac{e^{-\frac b 5}} 5\int_{b}^{\infty}\frac{e^{-\frac c 5}} 5\left(e^{\frac a 5-\frac c 5}\right)\text{ dc db da}\\
&=\int_{0}^{\infty}\frac{e^{-\frac a 5}} 5 \int_{a}^{\infty}\frac{e^{-\frac b 5}} 5\left(\frac{e^{\frac a 5-\frac {2b} 5}}2\right)\text{ db da}\\
&=\int_{0}^{\infty}\frac{e^{-\frac a 5}} 5 \frac{e^{-\frac{2a}5}}{6}\text{ da}\\
&=\frac{1}{18}\end{split}$$
Multiply this by 6 to get $\frac 1 3$ as the probability that D is last. Surprisingly, this is the same as if there were no person in front of D.
Comment
I think your formula works, but you should be careful not to overload $T_1$ to represent two different things, because $P(T_1>\max(T_2,T_3))*P(T_1<\min(T_2,T_3))$ is just 0, it cannot be greater than the max and less than the min. You could write
$$P(\text{D last one}) = P(T_1' > \max(T_2',T_3'))*P(T_1 < \min(T_2,T_3)) + P(T_2' > \max(T_1',T_3'))*P(T_2 < \min(T_1,T_3)) + P(T_3' > \max(T_1',T_2'))*P(T_3 < \min(T_1,T_2))$$
with the primes indicating after the first customer finishes (involving memorylessness).
