Johannine scholars traditionally assume "the other disciple" in 18:15 refers to the beloved disciple, and this is due to the similar language of 20:2-8. However, the language is not identical, especially because 20:2 names "the beloved disciple" before going on to use "the other" repeatedly, whereas 18:15 says no such thing, but specifically identifies this particular "other disciple" as being known to the high priest. Of course, the Gospel has just named Judas as being acquainted with both high priests, at 18:5, when it said Judas took a group of men from those priests on their way to get Jesus.
Why would the Gospel writer avoid naming Judas? The most obvious reason has to be the great shame of that situation. The writer can trust his readers will recognize Judas' position here, and sees no need to "speak" the disgraced name, which might only revive indignation for the reader's audience, just as the writer's main narrative is productively heading elsewhere. Judas, at this moment, literarily, plays only a bit role. He gets Peter inside. But for this analysis, going forward, I am less interested in the writer's narrative purpose than in the historical situation being represented by the narrative here.
Let's try this on in four dimensions, and see how well it "fits" what we know. Reconstruct the actual situation, in your mind, from the traitor's perspective. But please note: we are not here to imagine up clever or romantic scenarios, for fun. We must simply consider the basic possibilities, according to the known facts. (The main reason we should do this because they are being ignored; both of them - the possibilities, and the facts!)
Judas, inside, sees Peter's face at the door. An hour or so prior to this moment, Judas had been lucky to keep more than a swords' length of distance from Peter. But now? Judas is safely inside the compound. Surely Peter won't charge in waving a sword, and if he does, he won't get far. But perhaps Peter has come to consider switching sides, as Judas has? [However slight that possibility seemed to Judas, it would most naturally have occurred to his thoughts at that moment. Apart from unimaginable emotions, this moment for Judas was an irresistible turnabout situation. It's like Antony approaching the conspirators after Caesar's execution. It's like Hector coming outside the walls to Achilles. It's like Mordecai suddenly finding the upper hand against Haman.]
With the tables turned, Judas has nothing to fear, at least physically. Thus, evidently the key factor was Judas' curiosity at that moment - Peter's face at the door! - the possibilities were simply too intriguing. (Or perhaps is was simply some shred of loyalty. These two had just been close colleagues for 2 to 4 years. That can't be discounted.)
So Judas motions to the slave girl who lets Peter inside, proceeding to ask him the most natural and obvious question. Since it was one of Jesus' disciples who wanted Peter inside, clearly, Peter himself must also be one of Jesus' disciples. Thus she asks - Are you one of the captive's disciples? And when Peter responds in the negative, he therefore immediately has to distance himself from wherever it was that this other disciple is standing. He cannot stand with Judas, for multiple reasons.
A natural, logical flow of events is in evidence here. Peter doesn't randomly stand by the officers' fire. Peter is actively trying to avoid looking like he's with Judas! And the ironic thing is that this first cursory denial of Jesus now appears to be - somewhat self-consciously, in that moment - a strategic denial of Judas.
Strategically, what else could Peter have said? If Peter admits being a disciple of Jesus, then he's got to go stand next to Judas, ostensibly as an additional witness to Jesus' identity (and guilt?). Otherwise, if Peter is seen as being one who was with Jesus but who now won't stand with Judas, then Peter's own life could be in danger. "Are you with Jesus?" is tantamount to "Are you with Judas?". Now it isn't so simple.
But let's go back to the door, for a moment.
We've all read the story so many times that it seems predictable, inevitable. Peter comes up to the door and gets in. That's what we all do, at doors. We walk up and go in. In this case, however, considering the facts at that point, the option of waltzing into the high priest's own house - I dare say - should very most likely NOT have seemed natural, predictable or inevitable, in that moment, to Peter! No, indeed.
So, then, what's a more likely progression for what must have happened?
At the moment he looked through the gates, Peter was still safe. But Judas motions for him to be let in... and suddenly Peter was faced with a choice. Again, as overly familiar story readers, we've mainly come to suppose Peter looked in as if expecting to be let in. But since this cannot have been likely, we should take a moment to consider the complexity of the situation just at this point.
Judas sends the slave girl. Does Peter see the girl first, or does he see Judas first? We don't know. Does Peter step in because he thinks its a fortunate mistake, and then see Judas and realize what a pickle he's in? Possibly. Does Peter see Judas and then decide to step inside anyway? On sheer nerve, or on morbid impulse, or on irrational late night adrenaline? Maybe. Does Peter simply reason that if he took off running at this point they might start chasing him, and feel forced to step inside suddenly? Perhaps.
It could have been anything like this, though we'll never know which it was. (In that moment, Peter himself might not have known for sure who he saw, or even why he stepped in. What an impossibly stressful moment that must have been!) But there is something we should conclude with great confidence here.
One scenario that absolutely does not fit the text is to imagine "the beloved disciple" somehow being chummy with Caiaphas, while Peter gets the third degree in the courtyard from servants. That makes no sense whatsoever. No, despite unknown circumstances, and whichever reconstructed set of details may seem more likely (about how Peter got inside), the telling detail here is that "the other disciple" escapes scrutiny while Peter does not, and that this occurs even though it was precisely by their apparent association with one another that the slave girl first inferred that connection.
If their connection caused scrutiny for Peter, but not for this "other disciple", than he must have been Judas.
From a Gospel perspective, from a narrative perspective, from a literary or theological perspective, this sacred passage of scripture at hand makes the same point, holds the same purpose, and illustrates all the same themes, regardless of my reconstructed scenarios, and regardless of whether this question is answered in the positive or the negative. However, from an historical perspective, the entire situation makes a great deal more sense when we realize it had to be Judas who told Caiaphas' servant to let Peter inside.
One surprising historical detail does suggest itself, that may provide fresh insight into what happened within Peter himself, on that night. At the initial moment of truth, when Peter denied that he knew Jesus, it was most likely a conscious strategic decision by Peter to avoid associating himself with Judas. (See above.) In other words, it wasn't "Are you one of his disciples?" that Peter first denied. It was, "Aren't you one of his disciples too." No. I'm not. Not like he is. Not like Judas.
In this light, our traditional analyses of Peter's failure suddenly seem so two-dimensional.
"Do you know Jesus or not?" If it had been just that simple, Peter might still have denied Jesus, but it would have been a much more conscious denial. In such a case, the cock crow would not have surprised him. If there had been less complexity in Peter's motivation for his answers, there would have been nothing to realize later.
And perhaps this gives a worthwhile takeaway, an unexpected reward that sometimes comes from such historical study.
It isn't usually the clear and present threats to our allegiance that most challenge us.
It's when social and political situations get complicated that we have a harder time judging our own motivations, declarations, and loyalties, and whether we stand for the Lord.