The Empire did not enforce the ban, everyone still worshiped Talos. It was Ulfric's Sons of Skyrim which the Thalmor used to their advantage to be able to begin a Talos Inquisition, dragging those off in the middle of the night for even secret worship. It's one of the main causes of the war, when the Thalmor started dragging people away, little did they realize it was to aid Ulfric's rebellion.
"We didn't pay much attention to it when I was a boy - everyone still had their little shrine to Talos. But then Ulfric and his "Sons of Skyrim" started agitating about it, and sure enough the Emperor had to crack down. Dragging people off in the middle of the night... one of the main causes of this war, if you ask me." Alvor
The more they drag away, the more raise up arms against the Empire out of fear. Without Ulfric or the Rebellion the Thalmor would have no excuse for this extreme enforcement of the treaty terms, the longer Ulfric remains at large, the longer the Thalmor can pressure the Empire into allowing them to enforce the treaty. The Legions being busy with the rebellion can't enforce the treaty, the Thalmor however use that to go wild across Skyrim, unchecked and unchallenged.
Before under complete Imperium control, the Thalmor would have to have evidence to make an arrest and they would take longer to even arrest those who worshiped loudly, such as the Bard who would sing about Talos everyday in Markarth for a week, which is the Thalmor Justiciar base of operations. It is also seen while under the Empire's firm hand, the Justiciar leader needs evidence to make an arrest, he asks you to handle it.
The Thalmor are not allowed complete freedom while under the Imperials watchful eye, like many Stormcloak supporters would suggest, you would think the Thalmor own the Empire. They don't, they have to abide by the treaty while they're around the Imperials, if they don't they can be thrown into prison or even executed for breaching their agreement. Outside in the other Holds, Whiterun etc and along the roads, there is drastically less Imperial patrols. This is noted by many within Skyrim that since all of the Soldiers are out fighting, the roads are becoming more dangerous. So the Thalmor can stroll around all they want because the Empire is busy fighting a Civil War and Cyrodiil hasn't got many reinforcements to send Tullius.
If I might add, they are damn smart those Thalmor, they do indeed have good cunning. They're able to do all they want while the rebellion is raging since the Imperials aren't there to stop them, this would put it in the minds of the common citizens that the Empire is failing to protect them and they would join Ulfric's rebellion and thus cause more Legionnaires to be sent to the battle lines, allowing the Thalmor Agents to repeat the circle of of their plan, but the most devious of this plan is they wouldn't be able to do this without Ulfric, no wonder they want him alive and why he's considered a valuable asset. Allow men to fight each other, while the Elves remain untouched.
"The Thalmor. They stirred up trouble here. Forced us to divert needed resources and throw away good soldiers quelling this rebellion." - Tullius