This is complicated both syntactically and semantically, because the verb bow, which normally does not take a direct object in Present-Day English, may be understood in two different senses here:
- The attendant goblins deferentially permitted them to pass through the doors.
- The attendant goblins exhibited deference as they passed through the doors.
(I think, by the way, that this ambiguity is deliberate; that's exactly how bank guards are supposed to comport themselves.)
It seems to me that through the doors doesn't directly modify any of the terms actually present in the sentence but is a component of a clause of which the omitted pass (or something like it) is the implicit verb. Equally, however, it seems to me that through the doors is not merely a modifier of that omitted verb but its complement: specifically, a subject-related complement which defines the final position of Hagrid and Harry.
ADDED:
snailplane puts forward an analysis under which them and through the doors are arguments required by the verb bow. In those terms the analysis is incontrovertible.
EnglishLearner then asks me whether, as snailplane also suggests, the verb can be used "transitively" and has in this case a "direct object". Here I must dissent from snailplane's analysis on that grounds that 1) the use of transitive and direct object illegitimately imports terms proper to one sort of analysis into amother sort of analysis in which they are no longer proper; and 2) regardless of the syntactic role played by them, it is not semantically a direct object but an indirect object.
If you want to talk about how this sentence is put together, snailplane's "argumentative" analysis is probably better than mine. If you want to talk about how this sentence means, I think mine is better.
In either case, I think transitivity and direct object are best left out of the discussion. Both terms are much more complicated than can be conveniently addressed here.