Does the Product Owner role replace the Project Manager role in agile?
Short Answer: No.
Longer Answer: Sort of.
You see, there's no one to one mapping between traditional and agile roles. If there were, there probably wouldn't be a whole lot of difference between traditional and agile approaches, and probably very little point moving from one to the other. So a product owner is not just a new name for a project manager, and the two roles are very different in both what they do and how they do it.
However, that is not to say that there aren't things that needed doing before agile that still need doing once you move to agile, and someone will be needed to do them.
The simplest way to understand this is to say that the product owner role is as the 'single wringable neck' for the thing that is getting built. That is to say, they are the person that is accountable for its success. For example, it's the product owner that decides what the most important things are to work on next, that is closest to the customers / stakeholders for the product when it comes to keeping them engaged and gaining their feedback, and that is ultimately accountable for the success or failure of the product in the marketplace. It is their product, they own it, hence their job title.
What exactly this looks like will probably differ from organisation to organisation, but it often means traditional project manager responsibilities such as budget allocation, work prioritisation, reporting, stakeholder management and final sign off of work before delivery now move to the product owner. Other tasks may fall to someone like the Scrum Master if the team is following the Scrum framework, and some tasks that used to happen might no longer be carried out at all. For example, a big phase of testing carried out before a big release and go live process may be replaced entirely by continous testing, continous integration and continuous deployment, right throughout the process of delivery.
How some of these tasks are done often changes as well. For example reporting is now more likely to be done by demoing actual working outputs to real people and getting feedback on them, rather than producing slide decks and Gantt charts, but those are subjects for a different questions.
In practice though, especially in the early stages of moving to agile, a new product owner having to take on all of this work can be tricky, and they may choose to delegate it to a project manager if they wish. However, the important part to remember is that the product owner remains ultimately accountable for these areas, even if they do decide to delegate.