It doesn't say that God failed. If anything, it was Judah's faith that failed. What they should have done when the faced the iron chariots, which presented a unique challenge to them, was to turn to the Lord in faith, obey him, and drive out those in the valley. Instead, they gave up.
This is one reading which, I think, is possible.
The other one has also been listed already -- the phrase "Yhwh was with Judah" denotes Judah's
general victory, while there is a limitation necessary due to future historical developments in the geographical area.
We choose to interpret the passage by appealing to the precedent of Joshua 17:
vv.16-18 (ESV): The people of Joseph said, "The hill country is not enough for us.
Yet all the Canaanites who dwell in the plain have chariots of iron, both those in Beth-shean and its villages and those in the Valley of Jezreel." Then Joshua said to the house of Joseph, to Ephraim and Manasseh, "You are a numerous people and have great power. You shall not have one allotment only, but the hill country shall be yours, for though it is a forest, you shall clear it and possess it to its farthest borders.
For you shall drive out the Canaanites, though they have chariots of iron, and though they are strong."
This particular promise from Joshua is directed, admittedly, to the much larger tribes of Manasseh and Ephraim. However, it appears to give weight to a dominant theme throughout Joshua and Judges with respect to the iron chariots: nothing is impossible when the Hebrews trust in Yhwh. The limited conquest reviewed in Judges 1 (esp. vv.27-36) also affirms the other side of the coin -- the Hebrews encounter the limitations of their military prowess when their trust expires.
Thus I agree especially with Twistedsketch.