They really didn't have a chance. Technology had moved past them. The capacitive touch screen, multi-touch, fast mobile processors and the move to the web meant that mobile phones were becoming platforms. And Nokia wasn't a platforms business. To paraphrase Bill Gates, a platform requires that the economic value to the other participants exceeds that of the value to the platform. Nokia was never like that. In aggregate the organization had a fragmentation of SDKs, no single device domination, and didn't really value the other participants on their ecosystem.
Apple (or Steve Jobs) understood the value of the web (one of the crucial 3 pieces of the iPhone when it debuted) as a platform - though Apple pivoted over time to have iOS and the App Store itself.
That's just how organizations work. No one inside Nokia could realistically have acquired the power to make the decision in time. The company wasn't shaped to do this. They were doomed as soon as the tech caught up.