There are several good responses, but I'd like to give you another perspective.
Such a situation is very upsetting, indeed. And it happens surprisingly often.
It may be that:
- they have been independently working on this and were fired up by the appearance of your paper
- they side-read your paper, forgot about it, then developed the idea again, and then found your paper again, as a "related work".
- they intentionally subsumed your work and cited it (to avoid proper disputes, they cleanly cited it - as a form of plausible deniability)
We do not know which of these cases are true. You may have a hunch, but this is not a proof. There are places which have a preponderance to supersede existing work with their own - they do cite it, to be sure, but then inundate the market with their work to overwhelm the literature. Or, see point 2 above - this is something that - here, I borrow a term from Einstein - one could call "nostrification".
However, as described, they were at least careful to cite you - both your preprint and your main journal paper. It does not really sound like a proper case 2 or 3, or they would have tried to avoid citing you in the repeat publication and tried to refer to their old one. True, they did not exactly draw the attention to your work, and that's more than questionable. But, in my opinion, at this level it is not really actionable.
You were unlucky in that they got much more visibility; this does not only have to do with the better schools etc. It may have been the case with their better visibility throughout. Their prior work may have been so well known, that the readers preferred riding a new wave with them rather than with a unknown author (yes, you do not need to convince me that this is not how science should be done - hence, double-blind reviews; but once published, the name is there).
This is certainly not fair - but people are lazy; often, too lazy to try and find out where a piece of wisdom actually came from in the first place.
At the stage where you are, the question is: do you really want this dispute? Most of the time, priority disputes do not end well, often for both sides, sometimes from the side of the one raising it (who basically is a form of "whistleblower", even if on their own account). All people will remember will not be your paper, but your priority dispute.
That being said, there are exceptions; there are people who battle to be recognized, and end up being recognized. Still people will remember the battle and it may overshadow the scientific achievement.
At this stage, it becomes a meta-consideration.
If this result is so career-defining that you want to go all in and stake your whole reputation on it, then you could go for it.
Is this not the case, you can go for the indirect approach and just propagate your method intensely, present it and create awareness of it.
Finally, "if you can't beat them, join them". Maybe you could write to them in a friendly, or at least collegiate way. Sometimes, this is a way to make friends and find a collaboration with better known scientists.
And ultimately, if this research is behind you, however, and no longer a defining part of your career, you might be better served to altogether focus on the hot topics of your present and future activity and forget about it instead of wasting further time (and possibly reputation) on it. And this time round you will invest in promoting your upcoming strong results widely, so that that many people will know that these ideas come from you, before others pick them up and begin running with them.
All in all, and here I agree with the other responders, the case is far less clear-cut than many I have seen, and while you could pick a priority dispute, I think you should elevate yourself to the meta-level and decide on that meta-level what is the most important goal for you and balance it with the most likely positive outcome.
In the end, if you are a productive scientist, you can as well take the attitude "If they are happy with some crumbs of bread from my full-sized baguette, I can as well be generous." and many of the productive scientists I know have this attitude. And yes, that's even true if they are far more famous than you. After all, it shows that you are on the right track if they copy you.
TL;DR: In the end, it boils down to one thing: is this your only result of consequence and worth staking your career on it? Is it crucial to advance your career? Or is it one of many results and you expect to have a continuous series of results? Considered from this meta-perspective, this will inform your decision.
If, however, you take action purely as a matter of principle, this will dominate everything else in this matter, even your possibly important scientific result.