In the UK the Parliament sets minimum and maximum penalties for crimes, in the USA Congress does this. There is a huge difference between direct democracy (what ypu incorrectly call populism), and represenrative democracy. In the latter, parties apply screening processes, like looking at qualifucations, ethics and standards, links to the area they represent, and getting a balance of skills in their party. The idea is that then representatives can take tough decisions, but know they will be held accountable at future elections.
The judiciary is independent from the legislative branch, in modern democratic systems, as part of the seperation of powers. This means that even MPs or Senators, or heads-of-state, can be tried for breaking the established laws. Judges can interpret laws to some extent, setting precedents. If the legislative branch feel they have gone too far from the spirit of the law, they can issue more detailed sentencing guidelines, mandatory guidance, or new laws and penalties.
Governance is about figuring out how to live well together, to build trust, and avoid riots and lynchings. Moral Foundations Theory suggests a Justice/Fairness axis to our thinking has evolved as essential to being able to live in societies. We can look to mirror neurons and intersubjectivity as underlying our capacity to mimic others, understand their minds, and as the basis for the most widespread moral principle that we call The Golden Rule, often given as 'Treat others as you wish to be treated'.
Culture, can be understood as enforcing boundaries prohibitions and taboos, by hijacking the evolved responses of shame and disgust. See: How do ethicists tackle the question "Is it immoral to have sex in public places?" Is it possible to use rational and empirical ideas to answer?
Different cultures establish different boundaries. In Jonathan Haidt's work he identified differences between herding cultures where honour and threat of feuds are used to deter theft of animals which can represent generations of wealth but be lost overnight, versus agrarian cultures where sowing harvesting and storing crops are essential leading to different priorities - so we can understand different attitudes to justice as being adaptive.
Durkheim identified the collective enactment of shared attitudes to sacred things, as core to social cohesion, and avoiding a personal sense of meaningless and anomie he associated with social decohesion. A good example is habeus corpus, no detention without trial. This emerged from a 1200s dispute by barons with the absolute authority of the king, where he was forced into a concession. This proved to be lastingly better than absolute monarchies elsewhere, for instance in France where reform was far less possible, so arguably revolution was inevitable. Habeus corpus is now acknowledged in nearly all modern democratic states, and has become a binding value also of the international community, with criticism of Russian Gulags and Chinese detention camps regardless of cultural differences. It's not just an accident that habeus corpus helps build trust and strong societies, we can link it to game theory: Is the tyrannicide perpetrated by William Tell morally legitimate? None-the-less some Islamic societies, and China, understand themselves as having a different discourse about the balance between individual and state, and that is a lively area for discussion. I make the case that almost uniquely bloody wars in China's early history, led to Confucian ethics and an emphasis on avoiding succession struggles, discussed here: Was philosophy/philosophers involved in any revolutions?
How do citizens influence Parliament/Congress? Obviously elections. Also riots and protests. But more importantly I'd say, is through pressure groups and what we call 'civil society', the Non-Gocernmental Organisations people put their energy into to amplify the voices of groups wanting to enact shared attitudes to sacred values, like say wanting prison reform, more or less gun control, etc etc. The process of contention and cultural discourse, is far more complex than 'mob rule'. At it's best political and criminal reform should be about pursuading an informed electorate and it's represenratives through open debate. That is the real gold standard, for leading to a just system in line with a society's values, and change in the direction for it to flourish.