If Buddha is able to predict the future of other sentient beings how can freewill be possible as its very nature is that of unpredictability?
The Buddhist view is beyond the extremes of either absolute free will or absolute determinism. Our future depends on our acts and our choices now. However, our acts and choices, and indeed even our thoughts are constrained by the circumstances as well as our own habits, both of which are fruits of our own karma.

Now, regarding the prophecy, you can think of most sentient beings as rolling in a wide track (a wide furrow, like a river bed) -- unless they encounter some external force that will push them out, or make an extraordinary effort themselves, all their movements despite their freedom to choose will stay within the bounds of the track.

So in case with Devadatta, Buddha has seen that his cousin did not have enough force of his own to get off track. This is how he was able to make the prediction.