To answer this question rigorously, you need some sort of prior belief about the types of coins in the world.
To illustrate this, consider the extreme example provided by lulu in a comment to this answer:
suppose I flipped one coin a million times and it came up $H$ all but once. And then I flipped a second coin once and got $H$.
Suppose first that your prior belief about the world is that there are only two types of coins: fair coins and 100%-heads coins. With respect to this belief, we can be certain that the first coin is fair, and so it would be correct to prefer the second coin, which could be 100%-heads, and thus guaranteed to be at least as good as the first one.
However, if we modify our belief about the world to the belief that any given coin in the world has a heads-probability that uniformly falls in the range $[0, 1]$, then the first coin would be the better bet. I'll omit an exact calculation here. This similar question should give some hints on what the calculation would look like - there would be a (double)-integral over a triangular region under the line $y=x$ involved if trying to compute the probability that one coin is more biased than the other.
If you are not sure about the exact prior belief that underlies your problem, then you may be interested in some of the general strategies that appear in the multi-armed bandit literature. The multi-armed bandit problem supposes that you are given access to $n$ slot machines, and that at each step you choose a machine to play. At each subsequent step, you want to utilize the data you have seen so far in your ever-growing sample-size to determine which machine to play/replay next. This has a similar flavor to your problem, and the link lists some strategies, some of which have been proven to be optimal in some sense given various assumptions. A difference between the optimization task in the multi armed bandit context and yours is that in the multi armed bandit context, you are faced with a tension of exploration (gather more data) vs exploitation (maximize based on data seen so far), while in the way you phrased your problem, it sounds like the exploration phase is complete.
If you do a Google search for "multi armed bandit weighted coins", you get a variety of links similar to your problem of interest.