According to Sayed Khomaini fatwa, if the subject of a thing has changed from haram to halal, then it becomes halal. Hence, if the chess has changed from being a gambling game to a mental game, it becomes halal.
The same principal is applied by Sayed Sistani.