A corruption scandal involving cash in envelopes handed to a state's railway bosses for multimillion-dollar contracts has ended with the jailing of two people.