Short answer. Yes. After the prosecution rests its case, the court may dismiss the action on the ground of insufficiency of evidence on its own initiative, without any motion from the accused. The rule requires only that the prosecution first be given the opportunity to be heard.
What the law says
After the prosecution rests its case, the court may dismiss the action on the ground of insufficiency of evidence on its own initiative after giving the prosecution the opportunity to be heard
Rule 119, Section 23 — Demurrer to evidence. Read the full provision →
The court does not have to wait to be asked
A demurrer to evidence is usually thought of as something the accused files. The rule is broader than that. Once the prosecution rests its case, the court may dismiss on the ground of insufficiency of evidence either on its own initiative or upon a demurrer filed by the accused. The only precondition attached to the court acting by itself is that the prosecution be given the opportunity to be heard first. So an accused whose lawyer files nothing is not automatically carried through to a defence, and a judge who can see the case has not been made out may end it at that point.
What insufficiency is measured against
The timing tells you the standard. The assessment happens after the prosecution rests, which means it is made on the prosecution's evidence alone, before the accused has presented anything at all. The question is whether what the prosecution has put in could support a conviction. It is not a weighing of two competing versions, because only one version is before the court at that stage. That is why a dismissal at this point reflects a genuine assessment of the strength of the case rather than a procedural technicality.
Why this matters more than it sounds
For an accused it means the record made during the prosecution's case is doing more work than it appears to be. Gaps in that record, missing elements of the offence charged, or witnesses who did not say what the information alleged are not merely arguments to be saved for a closing brief. They are the material on which the case can be terminated at that stage, with or without a motion. Keeping a clear record of what the prosecution actually proved, element by element, is the practical way to make that outcome possible.
The choice this leaves the accused
If the court does not act on its own, the accused still has the option to file a demurrer, either with leave of court or without it, and the two carry very different consequences. Filing without leave waives the right to present evidence and submits the case for judgment on the basis of the evidence for the prosecution. Filing with leave preserves the right to adduce evidence in defence if the demurrer is denied. That decision deserves to be taken deliberately, with the strength of the record in mind.