How can a prospective PhD student know beforehand which universities have the most reputable teams/supervisors? I am interested in astronomy/astrophysics and cosmology. It is my understanding that choosing the best supervisor/team to work with for the PHD is more crucial than choosing the best (and most reputable) university.

If the above statement is correct. How can one identify the desired supervisors/teams? Probably the best way to to this is to read papers. The researchers that publish the most papers are clearly active in their field. But how can one, without even knowing these researchers find a way to locate the researchers who seem to be making good contributions to their field?

To put it in a simpler manner, does a website like arxiv.org and others have a way to identify the most active researchers (or teams that work on a specific problem)?
Most active does not mean most impactful or most influential.  Reading papers on your own, you will have a hard time distinguishing good papers from mediocre work.  Your best bet is to get recommendations from people who already work in that field.  Ask professors at your own university for recommendations or opinions.

If you have a specific problem you are interested in working on, then it does make sense to search for papers on that problem and do your own reading.  But you will still want to get advice from one or more people at your own institution who work in that area (or close to it).