"They used to fail."
Translation:Họ đã từng thất bại.
Without "từng", the sentence is "They failed", which means they failed (once) in the past.
"They used to fail" means they failed regularly in the past, therefore "từng" is required. However, "đã" can be omitted, as the word "từng" already shows that this is an event in the past.
This Vietnamese sentence can also mean "They have failed".
I have to disagree with you here. "They failed" = "Họ đã từng thất bại"; "They failed several times" = "Họ đã từng thất bại vài lần"; "They used to fail..." = "Trước đây, họ thường thất bại". This is one of those cases where you can't translate the literal meaning of the words because the two languages' grammars are different. The word "từng" doesn't imply repetitiveness, so we can't just use it to replace "used to", we can forcefully put the word "hay" with it and make the sentence "họ từng hay thất bại" but it's a very awkward sentence because the word "từng" is an adverb but the phrase "hay thất bại" is an adjective ("thất bại" can be a verb, but when you group "hay" with it they become and adjective, Vietnamese is crazy)
The word "từng" is used to indicate an event/events in the past with an uncertainty of when that event happened, the word "đã" is used to indicate an singular past event with a time mark. If we write "họ đã thất bại" it means "they have just failed", or "Đức đã thua thế chiến thứ hai" "Germany lost WW2" (since there's a time stamp on when Germany lost, we don't use the word "từng", as it will imply that even though Germany lost WW2, they can still win WW2 in the future)