This quest is given by a lord.
A lord will beseech you to recover one their family members from a prison in an opposing castle or town. Unfortunately, the ransom option does not appear to work in this situation. You can bribe the prison guard 100 denars to be allowed entry to the prison, but this does not help much as the guard keeps the key to the lord's chains (probably designed for the Deliver message to prisoner lord quest).
It is necessary to fight the guards (convincing a nearby village with a bribe of up to 300 denars to fake a fire drastically reduces the number of guards). Oddly enough, whatever your method in completing the quest, neither your relationship with the lord of the castle, nor that of the faction he represents will be harmed. However, you will receive a fair relationship boost with the freed prisoner and a significant boost with the quest giver in addition to 1500-2000 denars and 2000-4000 experience points.
Sometimes, you may encounter a bug where the prisoner lord becomes hostile to you, which makes it impossible to complete the quest. This can only be fixed by shutting down and reopening the game. Also, be aware that once you have rescued the prisoner, if the lord is defeated again, the quest will be cancelled and you cannot collect your reward.