Solution 1:

This question could be open to interpretation but my reading of it is that when the pedestrian arrives at the road he can immediately see the road from where he stands to $k$ time units along the road, so that he can identify a coming time gap of $k$ units. So, if this section of road is empty at that time, he crosses immediately so that $T=0$ and the total time taken for the crossing is $T+k=k$.

Let $X$ be the time of the first car arrival and condition on the event $X\lt k$, meaning that the next car lies in that $k$-length section of road:

\begin{align} E(T) &= P(X\lt k)E(T\mid X\lt k) + P(x\geq k)E(T\mid X\geq k) \\ & \\ &= P(X\lt k)\left[E(T) + E(X\mid X\lt k)\right] + P(x\geq k)\cdot 0 \\ & \qquad\qquad\text{since, if $X\lt k$, we count $X$ and then re-start the wait} \\ & \qquad\qquad\text{and if $X\geq k$, there is no waiting required} \\ & \\ \therefore\quad E(T) &= \dfrac{1}{1-P(X\lt k)} P(X\lt k) E(X\mid X\lt k) \\ & \\ &= \dfrac{1}{e^{-\lambda k}} \int_{x=0}^{k} \lambda x e^{-\lambda x}\;dx \\ & \\ &= e^{\lambda k} \left[ e^{-\lambda x}\left( -x-1/\lambda \right)\right]_{x=0}^{k} \\ & \\ &= \dfrac{1}{\lambda}\left( e^{\lambda k} - 1 \right) - k. \end{align}

Therefore, the mean time to complete the crossing is:

$$E(T) + k = \dfrac{1}{\lambda}\left( e^{\lambda k} - 1 \right).$$