If two players have the same score, the player who reached this score first will be higher on the leaderboard. Due to the way the leaderboards update, this might not always be immediately visible.