A classy operator on the level for O'Brien's father, Aidan, Sir Erec finished third to Stradivarius on Champions Day at Ascot.
He made a winning debut over timber at Christmas when beating Tiger Tap Tap and the pair met again here, but Mark Walsh was keen to take the race by the scruff of the neck at an early stage and attempted to make all on Sir Erec.
The 13-8 favourite sprinted clear after the last to beat his stable companion by six lengths in a race which provided the first two home in the Triumph Hurdle last year.
Sir Erec is now 5-2 favourite for the Triumph from 6-1 with Paddy Power.
Walsh said: "He was good and he had to do it the hard way.
"I would have liked a lead, but he'll learn from it and hopefully he'll show up in Cheltenham in as good form.
"He's won on soft on the Flat as well, so he's versatile that way."
O'Brien confirmed Cheltenham is the likely next port of call for Sir Erec.
He said: "He jumped well today. Making the running wasn't ideal, but he's uncomplicated and Mark gave him a lovely ride. He got him into a great rhythm and he said he jumped on the bridle at the second last. He's hugely exciting.
"He's two out of two (over hurdles) and while you would love to have more experience, he'll probably head to the Triumph Hurdle now.
"He sprinted from the back of the last. You would have said stamina would always have been his forte, but he showed plenty of speed today. He's won on testing ground (on the Flat) at Limerick so he's versatile.
"Fakir D'Oudairies (O'Brien's recent Cheltenham winner) had three runs over hurdles and two runs over fences in France and this fella is only having his second run over hurdles, so experience wise there is a big difference but I don't know if he'd have the engine of this fella.
"Looking at him (Gardens of Babylon) today you would say he might want further. He didn't travel as well as some of the others but seemed to gallop out well. We'll see what the handicapper does."