I have checked your code and ran inside RhoSimulator. Every thing works fine for me.
The code you have given i created a file(say test.html) and put into /app/test.html
Then from index.erb i have given a link to open test.html. And after three time clicks on button A , Button B is getting enabled and Button A is getting Disabled .
Hope this will help you, and there is no problem with your code too.