A former western New York trial court judge who resigned amid charges he accepted a bribe from a county political official was formally sentenced in Buffalo federal court on Tuesday.