What should I do if someone submit a review of a manuscript in journal system sooner than I know and I already prepared a detailed review?
I understand that this proxy review may be a cultural norm where you are. Nevertheless, it is considered malpractice in many places, and admitting to doing this can land you in trouble. Keep that in mind, because a publisher like Elsevier is massively cross-cultural, so they may take umbrage to something like this if it is reported.
Now, coming to what you get out of it. Your learning has happened anyway; I'm sure you expanded your understanding by reading all the references etc. At no point were you getting any credit for it - certainly not from journal, probably not from supervisor (I understand this particular review was not done with his knowledge). So there's no reason to be upset. I would suggest conserving your energies. If anything, you could show your supervisor your review, just so he knows how hard you worked. But if he is as lazy and uninterested as the question makes him sound, he may dismiss it.
Bottom line is, don't be upset. You volunteered to do the review by proxy and didn't inform supervisor what you were doing - so it's hard to find fault with anyone else. Learn from this incident and move on.
Talk to your supervisor. If he doesn't mind (and I don't see why he would object) he can write to the editor saying his student also wrote a review for the article. The editor can then register you and invite you to review the article using your own account.
I have a serious problem with the professor's modus operandi. He should not be allowing/asking students to submit reviews from his account over his signature, whether or not the publisher is OK with this.
A graduate student (in fact, anyone) deserves credit and recognition for the work he or she does. The professor should ask the editor if he can pass the review request along to a graduate student to be submitted directly by the student. That's a good public endorsement of the student.
That said, it's hard to know what the OP should do with this particular professor if/when the next review opportunity comes up.