The sentence as a whole is in past tense, but “ん、で終わる言葉” means “a word ending in ん”, which is present continuous tense.
It’s that part of the sentence in particular that is meant to show that 終わる’s form can be changed.
Different example:
今終わる番組。The tv show that is just ending. (Present continuous ← this is the important point)
今終わる番組を半分だけ見ました。I only watched half of the tv show that is just ending. (Past tense)
(Actually, maybe it would be more natural to say 今終わってる番組. I’m not that well-versed in Japanese yet. But if that’s the case, it shows all the more that the form of 終わる can be changed. )