We investigate the relationship between the hard X-ray photon index Gamma and the Eddington ratio [ xi = L(X)( 0:5-25 keV)/L(Edd)] in six X-ray binaries (XRBs) with well-constrained black hole masses and distances. We find that different XRBs follow different anticorrelations 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 anticorrelation 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-squares method for individual sources, from which the cross point of two fitted lines is obtained. Although the anticorrelation varies from source to source, the cross points of all sources roughly converge to the same point with small scatter (log xi = -2.1 +/- 0.2, Gamma = 1.5 +/- 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 and that their Eddington ratios are less than 1. We find that the BH masses of these seven luminous ULXs are around 104 M(circle dot), which are typical for 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 multicolor disk.