TUNIS — The insults were furious. “Infidel!” and “Apostate!” the religious protesters shouted at the two men who had come to the courthouse to show their support for a television director on trial on charges of blasphemy. Fists, then a head butt followed.

When the scuffle ended a few minutes later, Tunisia, which much of the Arab world sees as a model for revolution, had witnessed a crucial scene in what some have cast as a gathering contest for its soul.

“We’re surrendering our right to think and speak differently,” said Hamadi Redissi, one of the two men, still bearing a scab on his forehead from the attack last week.

The challenges before Tunisia’s year-old revolution are immense — righting an ailing economy, drafting a new constitution and recovering from decades of dictatorship that cauterized civic life. But in the first months of a coalition government led by the Ennahda Party, seen as one of the most pragmatic of the region’s Islamist movements, the most emotional of struggles has surged to the forefront: a fight over the identity of an Arab and Muslim society that its authoritarian leaders had always cast as adamantly secular.