Same plot sold twice by seller to two different people. Who is the rightful owner ?

Dear Sirs, I purchased a plot of land from Mr X and the sale deed was duly registered on 25.06.2008. My advocate carried out a detailed document check and confirmed that the title of the plot was clear and in the name of the seller. Thereafter we applied for mutation and the mutation of land was duly completed and sale was recorded in ROR on 14.08.2008. The plot was lying vacant since that time as I am an Army officer and was posted away from the city. Now, on coming back to the city I saw that someone else (Say Mr B) had occupied the plot. On taking out details from the registrar office, it has come to light that Mr X had sold the same plot of land to Mr A by registered sale deed on 22.11.2007 (i.e. seven months prior to selling it to me). The mutation was done on 05.04.2017 (almost 10 years after the registry of sale deed). Thereafter Mr A sold the plot to Mr B on 04.04.2017 by registered sale deed and the mutation was done on 11.08.2017. It is a clear case of Mr X selling the same plot twice. The plot was first sold to Mr A in year 2007 but he did not get the mutation completed for 10 yrs. The same plot was sold to me in year 2008 and I got the mutation completed in the same year. Please advise on the following queries 1. Who is the rightful owner of the plot in such a case? 2. What action should I take against the seller Mr X? 3. What action can I take against Mr B who has now occupied the plot? 4. Can I file a complaint against the Registrar for doing wrongful mutation because the original mutation had already been done in my favour? 5. Any other action that I should take in the complete matter? Thanking you in advance