We investigate the relationship between the hard X-ray photon index $Gamma$ and the Eddington ratio ($xi=L_{X}(0.5-25 rm keV)/L_{Edd}$) in six X-ray binaries (XRBs) with well constrained black hole masses and distances. We find that different XRBs follow different anti-correlations between $Gamma$ and $xi$ when $xi$ is less than a critical value, while $Gamma$ and $xi$ generally follow the same positive correlation when $xi$ is larger than the critical value. The anti-correlation and the positive correlation may suggest that they are in different accretion modes (e.g., radiatively inefficient accretion flow (RIAF) and standard disk). We fit both correlations with the linear least-square method for individual sources, from which the crosspoint of two fitted lines is obtained. Although the anti-correlation varies from source to source, the crosspoints of all sources roughly converge to the same point with small scatter($log xi=-2.1pm0.2, Gamma=1.5pm 0.1$), which may correspond to the transition point between RIAF and standard accretion disk. Motivated by the observational evidence for the similarity of the X-ray spectral evolution of ultraluminous X-ray sources (ULXs) to that of XRBs, we then constrain the black hole masses for seven ULXs assuming that their X-ray spectral evolution is similar to that of XRBs. We find that the BH masses of these seven luminous ULXs are around $10^{4}msun$, which are typical intermediate-mass BHs (IMBHs). Our results are generally consistent with the BH masses constrained from the timing properties (e.g., break frequency) or the model fitting with a multi-color disk.