Typically, a dative indicates location, while an accusative indicates direction. This has been discussed in many a question on this site ;) But this case is actually a bit tricky, therefore I think it warrants its own answer.
auf den Weg stürzen
with "Weg" in accusative, would indicate direction and mean something like "to plunge onto the path". Maybe the path is running through the ruined substation ;)
On the other hand
auf dem Weg stürzen
with "Weg" in dative, would indicate a location where they tumbled, like "they were on the path and tumbled there".
An additional complication in this case is that the "way" isn't understood literally. The protagonists were "on the way" or "on their way" to some place, there's not necessarily a literal path or road involved (it may be, but it doesn't have to).
This set phrase, "to be on the way", "auf dem Weg sein", is understood as a location both in German and in English. So what you want to express is something like
They plunged into the ruined substation while they were on their way back to the tunnels.
Sie stürzten in die zerstörte Unterstation, während sie auf dem Weg zurück zu den Tunneln waren.
Or to go back to the original sentence
And as they plunged into the ruined substation on the way back to the tunnels, Donovan said grimly:
Und als sie auf dem Weg zurück zu den Tunneln in die zerstörte Unterstation stürzten, sagte Donovan grimmig:
To give a bit more background, "auf" is one of the so called "Wechselpräpositionen". Those are prepositions of location that can, as we've seen, go with a dative or with an accusative. With a dative, they typically refer to the place where something happens. With an accusative, they typically refer to the direction or destination of the action.
The Wechselpräpositionen are
an, auf, hinter, in, neben, über, unter, vor, zwischen
To give some examples with other prepositions than "auf"
Sie gehen hinter das Haus. (accusative, direction / destination)
Sie spielen hinter dem Haus. (dative, location)
Sie klettern an der Felswand. (dative, location)
Sie werfen den Ball an die Felswand. (accusative, direction / destination)
Die Katze schläft zwischen den Hunden. (dative, location)
Die Katze legt sich zwischen die Hunde. (accusative, direction / destination)