Do you own him now?
Yes, of course you can earn it back. There are very few horses who will never give their trust over. But I think the hardest part will be the time. What gave you and him the bond before wasn't skills or exercises like 'groundwork' or 'respect building' or anything like that - it was time. You clearly spent a great deal of time with him and that's why he loved you.
I'm positive this horse will remember you, which will give you a good head start - but he may be very damaged by his racing career and not be willing to trust anyone, even you, just yet. If he's yours and your able go get the best horsey book you can find (I suggest "Sam (A Pastoral)") and sit down in his paddock or stall (depending where you can do so safely) and read it. Groom him, love him, give him hugs and kisses. Just spend time.