How do I handle plagiarism professionally and emotionally?
I'm going to suggest that it may not be plagiarism at all, but just parallel work. I don't have evidence one way or the other of course, but please consider the following points. 

First, I hope that your advisor is satisfied with your work and that your advancement toward a degree is not at risk here. 

Second, a charge of plagiarism is very serious. It is career ending in many cases and can be career ending for an accuser if it is judged to be a false charge. 

Third, parallel work is very common - especially in popular research areas. If two researchers start out at the same time they have access to all of the same tools, datasets, publications, etc. In particular, if they are connected to the "grapevine" they have access to the general feeling in the community about what is important and which lines of inquiry are "ripe" for exploration. In fields that have seen a lot of activity over a long time (mathematics, say), this is less likely as the questions get increasingly esoteric and the field becomes a web of narrow concerns. But working in esoteric fields has its own difficulties, of course. 

Fourth, your failure to publish could be due to a lot of things. It may just be that the reviewers of the other work had lower standards than those who reviewed yours. You can't control that, of course. But it may be flaws in your paper as, I hope, would be detailed in reviewer reports you received over time. It may just be that the reviewers found the other work more comprehensible. It may even be just timing. The paper landed at a time when some of the reviewers were actually looking for a paper like that. 

You may never be able to publish this work as you suggest, but you can move beyond it and publish future work based on it and the knowledge and skill you developed in exploring it. 

The only way that I can see it as potential plagiarism is if one of your early reviewers unethically took your idea and specifically set a student to exploit it while rejecting your work. I don't think that is impossible, but shouldn't be a concern with reputable journals. If it is, then the whole structure of review falls apart. 

But two people having the same, even detailed, idea at the same time isn't plagiarism. It isn't even uncommon. Similarity of result isn't plagiarism. Ideas are free for everyone. Direction of approach to solving problems is commonly known within a larger research community. 

You might be able to salvage some of your work for a new paper, even without extending it. Focus on what is different from and better than the now published paper. You indicate that there is some of that in your work. You can still make important contributions here, though not the ones you originally hoped for. 

I suspect that your advisor understands all of this and so is reluctant to make a charge that, if proved wrong, will destroy your career. 

For an exploration about how bad it can be see The Double Helix.

Bad things happen to good researchers. Sad. True. You had a bad experience. Don't let it damage your career. 



Let me note in closing, that getting beaten to the punch if it is really just that, leaves you emotionally in about the same place. Mad, sad, devastated. All natural.