B can arrive prior to A in the interval of $9-10$ Am.
In this graph i have changed timings, that A arrives between $0$ and $2$, and B arrives between $1$ and $3$.
Now we are only interested in area where B arrives prior to A, this will be the area where $(x,y)$ where $x > y$.
Because x which is arrival time of A must be greater than that of B's $(y)$.
Shaded area is the area where $x > y$,
Area of triangle = $\large \frac{1}{2} \times 1 \times 1 = \frac{1}{2}$
Area of sample space (square) = $4$
Probability of B's arrival prior to A's = $\Large \frac{\frac{1}{2}}{4} = \frac{1}{8}$