Property goes to that person who has better title on it.
Due to long period of stay, you have better title on property.
Also since you have builder-buyer agreement and possession letter with date, you are the rightful owner but you should have filed a suit immediately after the property was registered in the name of someone else.
Injunction should be filed to prevent wrongful entry of new party and to stop trespass.
File a criminal case against the builder for trying to cheat you by accepting money from you and getting the property registered in someone else's name. File a complaint against the new party as he has no right of forceful entry even if he shows rightful ownership transferred from builder.