To whom was Christ referring to in Luke 9:41?
Was Christ here upbraiding his disciples for failure to cast out the demonic spirit or the multitude for their unbelief?
Yes. This is most clear that Jesus's rebuke was directed towards his disciples when examining what follows the parallel passage from Matthew 17:16-20,
16 And I brought him to your disciples, and they could not heal him.” 17 And Jesus answered, “O faithless and twisted generation, how long am I to be with you? How long am I to bear with you? Bring him here to me.” 18 And Jesus rebuked the demon, and it came out of him, and the boy was healed instantly. 19 Then the disciples came to Jesus privately and said, “Why could we not cast it out?” 20 He said to them, “Because of your little faith...
Above in the Matthew passage, Jesus blames the disciples inability to cast out the demon in verse 20 on the very criticism he had in verse 17, their lack of faith.
Up to this point, especially in Mark, there have been several incidents were the disciples' lack of faith was on display (Mark 4:40, 6:51-52, 8:4,14-21,31-33, 9:19, Matthew 8:26, 14:31)
Jesus would gently question them about it or just let it slide, but increasingly he began to more publicly dress down His disciples.
31 And he began to teach them that the Son of Man must suffer many things and be rejected by the elders and the chief priests and the scribes and be killed, and after three days rise again. 32 And he said this plainly. And Peter took him aside and began to rebuke him. 33 But turning and seeing his disciples, he rebuked Peter and said, “Get behind me, Satan! For you are not setting your mind on the things of God, but on the things of man.”
34 And calling the crowd to him with his disciples, he said to them, “If anyone would come after me, let him deny himself and take up his cross and follow me... 38 For whoever is ashamed of me and of my words in this adulterous and sinful generation, of him will the Son of Man also be ashamed when he comes in the glory of his Father with the holy angels.” Mark 8:31-38
Notice how Jesus refers to Peter as Satan and associates Peter's shame of Jesus and his words with this adulterous and sinful generation. This is a shocking turn of events for Peter as he just made the great confession in Mark 8:27. In Matthew, there are only five verses between Jesus blessing Peter for his confession and rebuffing him as an agent of Satan:
Matthew 16:16-23 16 Simon Peter replied, “You are the Christ, the Son of the living God.” 17 And Jesus answered him, “Blessed are you, Simon Bar-Jonah! For flesh and blood has not revealed this to you, but my Father who is in heaven... 23 But he turned and said to Peter, “Get behind me, Satan! You are a hindrance to me. For you are not setting your mind on the things of God, but on the things of man.”
Jesus is not holding back. He doesn't have much time left. The apostles were supposed to bring the gospel to the world and yet they did not believe the gospel. They were willing to follow him around, but they were ashamed of what he said. They could confess Jesus as the Son of God, but they could not embrace his role as the Son of Man. They believed in him but did not believe him. And now, because of their lack of faith, a boy and his Father were needlessly suffering when they should have been able to heal them for Jesus had given them authority over all demons:
1 And he called the twelve together and gave them power and authority over all demons and to cure diseases (Luke 9:1)
This is a good reminder for us who confess Christ to check ourselves to see that we actually believe Christ and his words he has left us with through his disciples. He has given the power through his word to heal the lives of the people... do those around us needlessly suffer because of our lack of faith?