It seems grammatically correct, but awkward. I would change the introductory prepositional phrase to: For up to 25 minutes, the driver failed to realize that he was driving in the opposite direction .
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.