1. Question Restatement
How can we trust the Gospels if nobody was there to witness?
Note: There seem to be two different questions here: 1. What is the standard for determining the truth of indirect testimony; and 2: Can the Gospels be trusted?
2. Definitions
Disciples:
As the original question points out: It is difficult to accept the Gospels as credible eyewitness testimony if the writers were not even present, as John 4 appears to point out in some narratives.
But, this is inconclusive because "disciples" is often used in various ways that includes all, or some, or even just one of the disciples. For example, when the "disciples" or "Judas only" objected to the use of the ointment on Jesus. So, it seems reasonable to interpret "Disciples" as a rhetorical device similar to the "Royal We".
NIV, Matthew 26:8 - When the disciples saw this, they were indignant. “Why this waste?” they asked. 9 “This perfume could have been sold at a high price and the money given to the poor.”
NASB, John 12:4 - But Judas Iscariot, one of His disciples, who was intending to betray Him, said, 5 “Why was this perfume not sold for three hundred denarii and given to poor people?”
Primary Sources:
In history, a Primary Source is an original source of information created at the "time under study".
Genesis, (if written by Moses), is a great example of what a Primary Source is NOT. However, the Tablets of Stone inside the Ark were intended as "witnesses" and Primary Sources.
Eyewitness Testimony:
Eyewitness Testimony is an odd classification of evidence. But in all cases, this testimony is a declaration made under oath. In court, judges will sometimes make a Credibility Determination, (Legal Definition) regarding eyewitness testimony.
If a Credibility Determination is valued in courts, then it is reasonable for people to make credibility determinations themselves. The distinction is the necessity of "a wise judge", who is experienced in the matter, and objectivity.
Other than the Gospel of John, the other Gospels do not appear to be either testimony nor primary sources - nor do they claim to be. (1 John DOES claim to be eyewitness testimony.)
Hearsay:
In the Gospels, there are instances where Jesus was by himself, (like in the wilderness being tempted by Satan). Sure, Jesus might have told the disciples afterwards, who later told scribes ... But the question is about the credibility of this "hearsay". So, to say that the "hearsay" in these books can be believed because their writers are relying on "hearsay" is non-sequitor, (circular reasoning).
Actually, a bigger problem is the third degree of "hearsay" that occurred when Jesus "knew others hearts" - since the Disciples would have had to rely on Jesus' own "hearsay", or recounting Jesus' trials in the wilderness:
NASB, Luke 11:17 - But He knew their thoughts and said to them, “Any kingdom divided against itself is laid waste; and a house divided against itself falls.
So ultimately, if the writers intended to persuade their readers, then it is expected that readers exercise their own discretion, (as impartial judges). The Gospels were never intended to serve as Dispositive Evidence, (and they never claimed to be). There is nothing in any of the four gospels inconsistent with good-faith testimony from a group of people that endured a traumatic experience together. But, not finding serious fault doesn't establish credibility.
2. Narrowing it down to one Gospel - John:
If only one book of the Gospels was considered "credible" - it would have to be the Gospel of John - for many reasons:
The only book in the Gospels that appears to be eyewitness testimony is the Gospel of John. Its credibility begins by appearing to be written by someone with expert knowledge of Judaic practice through their penchant for pointing out facts that are super relevant to Judaism. It is also "prima facie" that the Gospel of John was intended as "eyewitness testimony" is because the text appeals to the personal pathos of the author by their consistent portrayal of the divisions in Judaism and their animosity against "the Jews", (but not against the "Hebrews"). The text also relates events that require this witness to have notable standing in Israel, being "privileged" enough to have been in very isolated situations with Jesus, (like being present at Jesus' trial, and also in Pilot's Praetorium). In fact, John's accounting for events is the only one that takes into consideration the Temple reckoning of days, (beginning at Sunrise), rather than the Halakhic/Babylonian reckoning. This text is also the only one that represents the crucifixion without contradiction.
Jesus' trial was recounted by someone there, who had authority:
But, Peter ultimately didn't get away with it.
NASB, John 18:16 - but Peter was standing at the door outside. So the other disciple, who was known to the high priest, went out and spoke to the doorkeeper, and brought Peter in. 17 Then the slave-girl who kept the door *said to Peter, “You are not also one of this man’s disciples, are you?” He *said, “I am not.” ...
None of the other Gospels come remotely close to the Gospel of John in authenticity.
3. "Christ Crucified" is the only "fact" the Gospels rely on
Ultimately, the Gospels are not necessary to "prove" the validity of Christianity. The only necessary fact that they themselves rely on is that Jesus acted in obedience to God: to advocate for mercy, unconditionally for everyone, even unto death, even death on a cross, (Philippians 2:8); and that, God granted life again, (to him and everyone else), for trusting that Jesus' unconditional advocacy for the world, (and our own advocacy for others), will bring life.
This is why Paul argued from nothing but "Christ Crucified":
NASB, 1 Corinthians 2:2 - For I determined to know nothing among you except Jesus Christ, and Him crucified.
Note: It is important to note that even Jesus said resurrection would be proof of anything, (Luke 16:31).
Jesus affirmed his own suffering was the necessary proof:
NASB, Luke 25:25 - And He said to them, “O foolish men and slow of heart to believe in all that the prophets have spoken! 26 Was it not necessary for the Christ to suffer these things and to enter into His glory?”
None of the New Testament writers felt it needed to be proven what Jesus did to be persecuted, (his advocacy), nor that he died, and not even that he rose again - because their Jewish audiences had all seen these three "facts" for themselves, (Acts 2). The Greeks, however, were persuaded by the "presence" of God, (the Holy Spirit).
NASB, 1 Corinthians 1 - 22 For indeed Jews ask for signs and Greeks search for wisdom; 23 but we preach Christ crucified, to Jews a stumbling block and to Gentiles foolishness, 24 but to those who are the called, both Jews and Greeks, Christ the power of God and the wisdom of God.
4. Answer - The Gospels were never intended as "Proof"
The audience of all of the gospels, and every other New Testament argument can reasonably be intuited as a hypothetical "friend of God", ("Theophilus", a court term for a friend of the court, or lawyer (Roman Term) - pointed out somewhere else on this site). And all of these arguments to "Theophilus" appealed to the Hebrew Scriptures as "facts". The only relevant material facts that could persuade Jews and Gentiles both were that: A.) Jesus advocated in mercy - for all, B.) That he suffered because of this advocacy; and C.) To support the conclusions that this advocacy is the only reasonable, sufficient, condition that can possibly bring abundant life, justification, as well as impart the Holy Spirit.
5. Conclusion - God is perfectly capable of proving himself
The misconception is that any Biblical writer intended these texts to be "proof". The Gospels are essentially Legal Argument, which appeals to what people witnessed as the "Basis in Fact", and pairing it with Prophecy as a sort of "Basis in Law". No lawyer expects their own arguments to suffice as "Proof" and "Evidence". And, this is why no Gospel writer would have intended their own writings to serve as proof.
NASB, 1 Corinthians 2:4 - ... and my message and my preaching were not in persuasive words of wisdom, but in demonstration of the Spirit and of power, 5 so that your faith would not rest on the wisdom of men, but on the power of God.
NASB, Jeremiah 31 - 31 “Behold, days are coming,” declares the Lord, “when I will make a new covenant ... “I will put My law within them and on their heart I will write it; and I will be their God, and they shall be My people. 34 They will not teach again, each man his neighbor and each man his brother, saying, ‘Know the Lord,’ for they will all know Me, from the least of them to the greatest of them,” declares the Lord, “for I will forgive their iniquity, and their sin I will remember no more.”
Note: Jeremiah 31 is sometimes argued to be "post-apocalyptic", but if so - no new covenant was made by Jesus.
NASB, Ezekiel 20:41 - ... and I will prove Myself holy among you in the sight of the nations.
It is not, and was never, necessary to "prove the existence" of God and that Jesus is the Messiah. God is more than capable of proving this himself. The fact that Christians rely on texts as "proof" is a horrible repercussion of the "Sola Scriptura movement".