While X uses Nokia's X Software, a forked version of Android, Lumia 520 runs on Microsoft's Windows Phone OS. Both devices come incorporated with Nokia and Microsoft services such as Outlook, Skype, HERE maps (Nokia's own APP store), Nokia Music and so on. The best thing about the Nokia X is that it can run many Android apps. Moreover, if you do not find it in Nokia store then you can side-load it from another store. Given that Android has a larger app database than Windows it might not be possible to run the entire app, which is a plus point for the X.
Winner: Nokia X
Battery
Lumia 520 gives you talktime up to 14.80 hours whereas Nokia X gives only 13.30 hours. In this round, Lumia 520 wins the race.
Winner: Nokia 520
Conclusion
If you are looking for range of apps, then the Nokia X, priced at Rs 8,599, is a better option for you. However, priced approximately at Rs 7,700, the Lumia 520 offers better hardware than the Nokia X.
If apps are not important to you, then the Lumia 520 wins the race with better camera, a display with scratch resistant coating and the prospects of faster Internet browsing speed.