I don't think a re-surged Massa would beat Alonso, so in this comparison, at this time he is a number two. Given the situation at Ferrari in 2008 and 2009 I think they did treat Massa as a number one. it's possible the accident knoked some confidence out of him. It's also possible that he's physically not the same, it was a massive blow to the head, that may have ramifications beyond what we're perceiving as a loss of confidence.
In any case, I think Ferrari sticking with him this year and last was more about indebtedness. Unless he's able to put together a race win or two for the balance of this year, I think it's too little too late. And therein lies the issue with the situation... does anyone believe that if Massa is able to put together a race win that Alonso wouldn't be in front of him?
OK so would Ferrari accept 2 second places from him with Alonso in front of him?
To be honest, what Massa needs to do is take points away from Alonso's rivals. In Spa and Monza, he did that. At Spa he took points off Webber late in the race and at Monza would have taken points away from Vettel, Webber and Kimi (assuming they all finished).
If Massa can be close to Alonso and take points off his rivals - Ferrari may keep him as #2 next season, especially if he contributes to Alonso's success.