There are 3 simple ways of doing this: easy, easier, and easiest. But I can't say which is which.
Style 1: Use 2 solenoids: Direction and Brake. Direction is a 'double throw' it has 2 ins; connect normally. Brake is a single: use on exhaust, only use A or B.
Style 2: Use 2 solenoids: Up and Down. Both are singles. Tubing could be a problem. (Exhaust through closed solenoid). the basic Idea is that when you turn on Up, it goes up. Turn on Down, it goes down.
Style 3: Use 1 solenoid: a 'double pull, double throw'. Basiclly: when off, A and B are off. When on A side, A gets pressure, B is exhaust. On B side it's opposite: B gets pressure, A is exhaust.
That should be easy enough.