What was the judicial system like in Medieval times? Living in a castle, or in the village surrounding it?
Most medieval communities held hearings which were much speedier than today's lengthy trials. They usually lasted less than half an hour.
Earlier medieval communities had much more social responsibility than today. If one member of a village claimed they'd been wronged, he or she would complain and every villager had to join in the hunt and persecution of the criminal or they would all be held responsible as a whole.
The Middle Ages were serious about their religious offenses. Each town's church generally ran its own kind of court to investigate everything from bad attendance to heresy. However, the church was also a place where criminals could avoid sentencing or punishment: they could cry "sanctuary" and the offenders could hang out, without fear of being followed.
Criminals who committed lesser offenses were often subject to a policy of three strikes and you're out—literally. Rather than killing them off or letting them clog up prisons, repeat offenders were often simply banished from a city and not allowed back. The offender usually went to the next village, and then the next.
Capital punishment was sentenced only in the most serious of cases, which included murder, treason and arson. These criminals were usually hanged.
Most European countries had legislation preventing their kings and queens from completely running amok. England's Magna Carta, which limited the monarchy's financial powers among other things, is just one example.
Beheading was considered a "privileged" way to die and was reserved mainly for members of nobility, rarely commoners. Treason was their crime of choice and the beheadings usually took place inside private castle walls.
It was only during the Reformation period (beginning in 1550) burning witches really became "popular". Even at the height of hysteria, witches in England were rarely burned. They were usually hanged instead.
Mutilation was occasionally used as a punishment against those who'd committed serious crimes. Usually, though, medieval law simply used the prospect of losing bodily bits and pieces as an empty threat, rarely actually carrying out the deed.
The Rack, which continually stretches its victim's body in opposite directions–wasn't likely ever used in England until the very end of the 15th-century and the medieval period. It was employed freely beginning in the torturous heydays of the 1500s, when Queen Elizabeth I and other European monarchs began purging their countries of religious opponents.
And so, inside those cold castle walls, and tiny little villages surrounding them, justice was served.