The reference to "most junior counsel present" does literally mean the most recently qualified barrister who happens to be in the court. That is confirmed by Polter's response: "I was only called last term!"
The story takes place in 1860. By this time, it was common for the court to assign a barrister who happened to be in court to conduct the defence of an accused person. According to Bentley, English Criminal Justice in the 19th Century (1998), p 110–111:
Assignment was a practice developed by the judges as a means of ensuring that prisoners facing grave charges did not go undefended for want of means. The judge would ask one of the counsel present in court to undertake the prisoner's defence without fee, a request never in practice refused … During the debates on the Prisoners' Counsel Bill of 1834, one of the arguments used against the assignment of counsel clause which it contained was that the judges already had power to assign counsel, and that counsel never refused to act … So far as one can judge from trial reports, assignment of counsel to poor prisoners in felony cases was, and remained, a rare occurrence during the late 1820s and 1830s, but became increasingly common during the 1840s and 1850s.
But I can't find any historical analogue to Polter's virtuosic success in prosecuting a "dock brief" on behalf of the Crown. As Bentley explains, the practice of assigning counsel evolved for the benefit of the accused, not the Crown. And the barrister assigned was not invariably the "most junior counsel present" (p 114):
The selection was made from amongst those in court not already engaged in the case. Sometimes the judge would call on the most senior counsel in court. Sometimes one of the barristers present in court would volunteer his services. Occasionally the accused would be invited to choose from the barristers in court.
Modern practice
The scenario in the story, where the advocate briefed to appear is in another court, having assumed (or hoped) that the present matter would not be reached in the judge's list, remains common in busy criminal courts throughout the common law world. Judges have various ways of dealing with this situation, where a hearing cannot proceed efficiently because of a lack of legal representation.
Some matters, such as hearings at which an accused person must decide whether to plead guilty or not guilty, or make scheduling arrangements for trial, or be sentenced for a minor offence, are still routinely handled by lawyers who receive instructions on the day of the hearing. This is usually formalised through systems like the duty solicitors scheme operated by the Legal Aid Agency.
When duty lawyers are unavailable, it is not unheard of for judges and magistrates to ask counsel physically in the courtroom to provide limited pro bono assistance to an unrepresented party. Such requests are limited to the kind of representation ordinarily provided by duty lawyers, and would not extend to conduct of a jury trial with zero preparation. As well as being significantly more demanding due to the greater complexity of modern criminal law practice, this would today be considered a breach of the right to a fair hearing.
I have personally seen lawyers present in the courtroom, in suburban magistrates' courts around Australia, appointed to represent defendants at procedural hearings when there is no duty lawyer available. Lawyers volunteer for this as part of their professional duty to the administration of justice, or even as a way to find new clients. However, this never applies to a prosecution brief. At worst, an irritated judge might force another prosecutor in court for unrelated cases to account for their colleague's absence, or dismiss the case for want of prosecution.