Like Miko has corrected, the two sentences from your textbook are wrong.
> I was thinking that ようになります and ようになりません were used when you are able/not able to do something in the past and gradually that situation changes.
I find ようになります and ようになりません don't have any sense of ability or past, but yes I think they say change, in the future. To make it past tense, it needs to be added with た. You might already know, but to connect with た, we conjugate the previous word, and they become ようになりました and ようになりませんでした.
And to add the sense of ability, it needs [-e] sound: 話せる、話せた、話せない、話せなかった;聞ける、聞けた、聞けない、聞けなかった;and sometimes [-a] sound: 分かる、分かった、分からない、分からなかった. No, this one has, from the beginning, the ability sense, I mean it's not conjugated. 分かる is the base form.
> - 田中さんは日本へ帰って来たら、日本語が話せなくったそうです。
> - 日本語の勉強を始めてからもう半年になるので、前より日本語の文法がわかるようになりました。
>- 毎日ニュースを聞くようにしたら、日本へ来たばかりのころよりニュースが聞けるようになりました。
The first sentence is correct. It can also be 話せないようになったそうです。
It's confusing to me, too. :) Let me just list up some possible expressions:
(I'm continuing to another post.)