We arrived at the last stop just when I was starting to think the car might give out.

Literal

Car [subject-が] break-down [question-か][quotative-と] thought [time-ころ] terminus [at-に] arrived-[polite-ました].

A casual bus/car narrative. いかれる is slang for 'to break down, to go kaput, to be done for' — the passive form of 行く (literally 'be taken away'), lexicalized into this idiomatic sense. ~かと思ったころ ('just when I was thinking X') is a set phrase for 'at precisely the moment I thought.' 終点 ('terminus, last stop') is the standard word for the final station or stop on a line.