It depends on how cold your attic gets, how much moisture there is in the air, and how well the duct is insulated whether or where things will start to condense.
A 6" round duct has an area about 6% less than a 5x6" duct. So, in that view, the rectangular duct should flow the air better. It's easier to find adjustable elbows for round duct than rectangular.
Ducts get sized by their effective length. That's the actual linear length PLUS additional effective lengths for each change of direction that slows down the air flow. A round duct, even with changes of direction probably has less restriction in it than rectangular ones partly because they tend to be a smoother rather than square.
Whatever duct you put in, insulate it. Ideally, the whole thing would slope towards the outside, but if you can keep it from condensing until it gets over the peak, it should still work. It's very disconcerting to have cold condensation dripping down out of the fan assembly.
I think you'll find that the instructions for the fan say that for a 32' actual length (probably closer to 38' or so with the angles in effective length) that you should use the 6" round...that's mostly because it fits onto the fan easier than adding another fitting to change the outlet to rectangular. Depending on how it is sized, you might get enough air flow with just a 4" round, but it won't let the fan maximize its output.