Whether we were tired or not, we had to keep walking.

Literal

Tired-or-not [whether-ようと] [or not-いまいと], we [topic-は] walk continue [must-ねばならなかった].

~ようといまいと means 'whether or not.' The volitional ~よう paired with まい (negative volitional) creates a comprehensive 'either way.' ~ねばならなかった is the past form of the formal obligation ~ねばならない.