No. The PS2 version of Harry Potter and the Prisoner of Azkaban is a single-character action-adventure; you control Harry Potter exclusively throughout the entire game.
Ron, Hermione, and others appear as NPCs in cutscenes or AI companions during specific sequences, but they are never playable.
(Later Harry Potter games, e.g., LEGO Harry Potter, do allow character switching.)