I feel sympathy for anyone in senior position who gets laid off/fired, only to be replaced by younger/cheaper/foreign workers.
But then I have to remind myself, companies are not in the business of justice or patriotism. It is all about making the most bucks. And many times they make wrong decisions.
Remind yourself it was not personal against you. The same scenario has probably repeated zillion times in other places.
Yes, it's just business, nothing personal. I don't fault the boss, or the H-1Bs. In this case the company changed directions, and my skills were not a particularly good match to the new requirements.
There have been several other times I was displaced by H-1Bs (mostly desi) usually under less clear-cut circumstances. Being asked to train my replacement is rather galling.
Still, for whatever reason I LIKE Indians, mostly, I think because we get each other's sense of humor, and there's a certain devil may care madness to their methods.
One of my early bosses was, like you here on a student visa, then bridged to permanent resident and then citizen. The company he built and is still the CEO had $1 Billion in revenue last year.