There's a mod that extends prison sentences so you can get around the whole having to execute every single Lord you take captive to prevent them from instantly attacking you again.
In the Vanilla game this should be the case as well though, Prisoners escape entirely too easily forcing you to have to execute them, which in turn gives you negative reputation with everyone and their mom.
Even Ransoming prisoners should force Lords to not be able to attack you for awhile though. There's a Bribe thing you can do currently where you swear to not attack someone for a certain amount of time, this should be automatically applied when ransoming as well.