People have choice to believe in whatever they like, they are not free to do so but have the choice:
لَا إِكْرَاهَ فِي الدِّينِ ۖ قَد تَّبَيَّنَ الرُّشْدُ مِنَ الْغَيِّ
...
Let there be no compulsion in religion: Truth stands out clear from
Error ... [2:256]
إِنَّا هَدَيْنَاهُ السَّبِيلَ إِمَّا شَاكِرًا وَإِمَّا كَفُورًا
We showed him the Way: whether he be grateful or ungrateful (rests on
his will). [76:3]
If we were free then there would have been no punishment even in the Hereafter which is not the case.
However, although Dunya (world) is not the place for Justice and people are allowed to do many wrong things in stealth, but anything that one does and it has social effect is ruled by social rulings introduced by Islam. Even every small social effect has its own respond back, advertising for wrong beliefs is just one of those wrong actions which have social effects. Having a special wrong belief is not a Dunyaish crime (it is crime but will be treated in the Hereafter), but advertising for it and hindering the others from the path of Allah and seeking in it something crooked, then we are ordered to withstand them and forbid them from what is wrong. However, according to Islam (I know only the Shia part) this forbidding from what is wrong has many different levels:
First the person who identifies the wrong social action by others should hate that action and at the same time should not feel like he is better than those wrongdoers, everyone may go wrong even ourselves, so encountering them should be like a father is to encounter his child, with kindness.
Second, the one who is to forbid the wrong action should avoid direct apposing, but should instead change in his relationship with those people so that maybe they would understand he is sad for what they have done, or himself do the right deed so that they understand what they have done was wrong. If this didn't work, then he should say their deed was wrong, if it didn't stop them there are higher levels of forbidding the wrong deeds.
When it comes to the level of Islamic government, then forbidding from what is wrong can come into social punishments and even fighting against wrongdoers, like those who advertise worshiping idols.
All these stages of forbidding from what is wrong has their own rulings and are not arbitrary, and none happen to really change the mind of the wrongdoers, but to stop their social effects, defending the social freedom, no one is allowed to pass the limits of him/herself in a society and overtake the rights of the others.
We have yet something about mentioning people what they personally think and believe, but that's not like commanding or forbidding, but only as a sincere advisor.