I think they'll work something out where they buy-out his option (Rangers are on the hook for that $6m, but only the buy-out) and then the Cubs bring him back at $14m. So he would earn the same amount but the Rangers pay $6m of his contract instead of the Cubs paying all $20m.
Edit: it also doesn't matter if they go over this year. Were they over it last year? Did their penalty for being over the threshold reset if they were over prior years?