All perfect praise be to Allah, The Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallahu ‘alayhi wa sallam, is His slave and Messenger.
The question is rather general and is not about a specific incident; accordingly, our answer shall be general as well.
According to the scholars, the established rule is that when there is conflict, public interest is given precedence over private interest. This is evidenced by the hadeeth in which the Prophet, sallallahu ‘alayhi wa sallam, forbade meeting the trade caravan (to buy goods from it) before it reaches the marketplace. [Al-Bukhari and Muslim]
An-Nawawi quoting Al-Maaziri, said, “The Islamic Sharia considers the interests of the people. The collective interest of the group is given priority over the private interest of the individual. When the desert dweller sells his goods by himself, all the people in the marketplace benefit and buy at a cheaper price, so all the town people benefit of this. Hence, the Sharia gave priority to the interest of all the town people over the interest of the (individual) desert dweller...” [Sharh Saheeh Muslim]
If a politician committed a legal violation that would cause harm to the country and its citizens, then the Muslim judge in the Sharia court has the right to subject him to Ta‘zeer (discretionary punishment) proportionate to the gravity of his violation and crime in order to preserve the (public) interests and eliminate evils.
Allah knows best.