Does knowing the ratio of masses of the elements in a compound lead to the unique chemical identity of the compound?
No, knowing the mass ratios is not sufficient by itself. In the absence of additional information (for example, molar mass) that would only be enough information to determine the empirical formula, which is the formula that contains the smallest integral ratios of atoms. (E.g., the empirical formula of $\ce{C2H6}$ would be $\ce{CH3}$.) There are (theoretically) infinitely many molecules with the same atomic and mass ratios, yet differing in the actual molecular formula.

Further, even given the additional information of molar mass (so that the molecular formula can be determined), the existence of isomers precludes identification of a singular, specific compound without more sophisticated analysis. For example, $\ce{C3H6}$ could be either cyclopropane or propene. $\ce{C3H6O}$ could be as innocuous as acetone, or it could be highly carcinogenic epoxypropane. With more atoms, the number of possible isomers grows very rapidly. There's a nice table giving the number of isomers of alkanes of different lengths in this article. By the time you get to $\ce{C30H62}$, the number is $4111846763$. (Note, this is only considering structural isomers; accounting for stereoisomerism, the number would be even more astronomical.)