I had trouble following their dialogue but I think they had no love for the Empire and decided to help them escape rather than turn them in for the reward. And Andor didn't take the ship, they gave him a lift, I believe.
I think they thought they might be with the Empire but they realized that they were prisoners and the Empire is the one that poisoned their water so they decided to help out.