What to do if a referee plagiarises the result after rejecting a paper?
I suggest that you write a formal letter to the journal editor who handled your submission.  (Make sure it is the same editor.)  Give all the relevant details, including dated copies of all correspondence (whether electronic or printed).

The editor should know who refereed your paper, and although the editor will not reveal their names to you (I assume that blind refereeing was done), he or she would be in the best position to act on the matter.

Perhaps the best thing that could happen is the editor agrees that some unethical behavior occurred, the editor helps you file a case against the erring referee, the erring referee gets penalized, and proper attribution is given to you.

Perhaps the worst thing that could happen is the editor does not believe your story, thinks you are just looking for trouble, and tells other editors and referees that you are a "bad, crazy person."  Or the editor does believe your story but is a close friend of the erring referee and so acts as if he or she does not believe your story.

Either way, at least they know that you are aware of this unethical behavior and this will perhaps discourage the erring referee to continue with the unethical behavior in the future.