Honestly, I've never entirely understood the rationale behind the ransom calculations. Without looking at the relevant code, I think that there are certain cases where you can end up with a ransom that's payable the first day, but it's rare.
They are, however, entirely set by the game; judges have no say whatsoever in how high they are.
We've talked a few times about changing how they work, allowing for more important prisoners to be kept for longer and held for higher ransoms, but it's never been a high priority.