Easy… I thought, but not being able to find my old scribbly notes from long ago I looked up in “A Handbook of japanese gramar patterns for teachers and learners”, good book. Also, not as easy.
うちに
is used with expressions that indicate duration over an interval of time and means “while that state continues” or “within that period of time.”
~ているうちに
Means “while one is …ing.” Followed by an expression indication the occurence of an event or a change. V-ている is used more than V-る, but the poattern V-うちに is sometimes used.
~ている間に
Indicates a period of time in which a state/action continues, and a sentence that expresses an action or a situation within that time follows. The predicate of the following sentence is a verb, and forms that do not indicate duration, like する、…しはじめる、…になる、are used.
…To describe a past matter, …た間に is also used. When the agents of the first and second clauses are different … , it means the two persons acted in parallel at the same time.
私がてんぷらを揚げる間に、母はおひたしと酢の物とみそ汁まで作ってしまった。
While I was making tempura, my mother made boiled greens, a vinegared dish, and even miso soup.
So going back to your question, i’d say that in this case we are talking about a state change → becoming tired. Therefore 内に is the way to go I’d say. If you were to do something else whilst driving, such as your friend talking to you, then あいだに would be more suitable.
運転している間に友達に話しかかれた。
As a side note, as a vague memory from my notes. うちに conveys more of a urgency to do something within a “relative short” timespan, depending on the situation, OR, a lack of volition. In this case, you cant control our action of not becoming tired.
間に more of the opposite, not as urgent and more in control.