Your first sentence is wrong:
wrong: Sie hatten sie die alten Zahnräder geliefert.
They had they delivered the old gears.
correct: Sie hatten die alten Zahnräder geliefert.
They had delivered the old gears.
The components of this sentence:
- sie
subject and agent
- hatten ... geliefert
verbs
- die alten Zahnräder
accusative object and patient
The agent is the person or thing who/that performs an action. The patient is the person or thing on who/that the action is performed.
active voice:
- agent = subject and mandatory
- patient = accusative object
passive voice:
- agent = optional (if present, is is part of a prepositional object)
- patient = subject
The correct passive forms are (optional agent in brackets):
- Zustandspassiv
Die alten Zahnräder sind (von ihnen) geliefert worden.
- Vorgangspassiv
Die alten Zahnräder waren (von ihnen) geliefert worden.
Here is the translation of your second sentence:
Sie waren mit den alten Zahnrädern geliefert worden.
They had been supplied with the old gears.
This sentence is not wrong, but it has a completely different meaning than the first sentence. It is in passive voice, but what was the agent in the first sentence is here the patient and the former patient is now neither agent nor patient but a part of a prepositional object.
You last sentence is also wrong:
wrong: Sie waren die alten Zahnräder geliefert worden.
correct: Ihnen waren die alten Zahnräder geliefert worden.
This is in English:
The old gears had been delivered to them.
But the passive form of the first sentence is:
Die alten Zahnräder waren von ihnen geliefert worden.
The old gears had been delivered by them.