Relaxation, chaos, and thermalization in a three-mode model of a Bose–Einstein condensate