When a witness, under examination, refuses to testify or to answer a question put to him or her by the grand jury, the foreman shall proceed with the witness into the presence of the court, and there distinctly state the refusal of the witness. If the judge, upon hearing the witness, shall decide that the witness is bound to testify or answer the question propounded, the judge shall inquire of the witness if he persists in his refusal. If the witness does persist in his refusal, the court shall proceed with him as in cases of similar refusal in open court.