NEW DELHI — When the right-wing Hindu political leader Bal K. Thackeray died last weekend, the city of Mumbai responded with a practiced, if anxious, efficiency. Merchants hurriedly closed their shops. Traffic thickened as people tried to rush home. India’s most populous city, a global financial center and moviemaking capital, was effectively shut down.

Shaheen Dhada, 21, a medical student who lives on the outskirts of Mumbai, was a bit annoyed. Like most people, she understood what was happening: Mr. Thackeray’s hard-line Shiv Sena party has dominated Mumbai for decades, often using intimidation, violence or vandalism to enforce citywide strikes or bans against certain movies. This time, Shiv Sena wanted a citywide signal of deference and respect for Mr. Thackeray.

Ms. Dhada decided to post a mild message of protest on her Facebook page.

Why, she asked, should an entire city be involuntarily shuttered to mark the death of a politician? Her friend, Renu Srinivasan, 20, read the post and hit “like.”

The post went up on Sunday. Within hours, a Shiv Sena official had complained to the police, who notified Ms. Dhada’s family. Intimidated, she quickly posted an apology and closed her Facebook account, her lawyer said. But by Monday, Ms. Dhada and Ms. Srinivasan had been arrested and charged with engaging in speech that was offensive and hateful — for a post that many experts say was neither.