In Agile Scrum defines the product owner role. Broadly, the product owner is the voice of the business or the client and they are accountable for ensuring that the agile software development team delivers the maximum possible business value. The product owner manages the product backlog and prioritises what work will be done by the agile software development team. This may be done in collaboration with other representatives from the business, but ultimately they are the one role responsible for this. The scrum product owner may write user stories or may have the team write these.
Scrum does not define a business analyst role. So if you choose to have the business analyst role then it depends upon the responsibilities you give to that role. The business analyst role is more likely to be on the agile development team’s side of the fence whereas the product owner would be on the business side. But it’s a pretty blurry line so I'd define the role of the agile business analyst as facilitating the process of getting information that the development team needs out of the product owner.
At Equinox IT we use certain Scrum practices, but we do not use Scrum in its entirety on our agile software development projects. So we don't define the product owner role, but we still ensure the product owner responsibilities are done. We use system analysts on our project teams to elicit what the business needs, write user stories with acceptance criteria, analyse detailed requirements during sprints and help test the software. Our system analysts along with other members of the agile development team and client business representatives work together to fulfil the product owner role of prioritising work on the product backlog to ensure the highest business value is delivered.
On some projects the agile business analyst may act as the product owner, but they are effectively operating on behalf of the business. So more often this happens on internal projects, as opposed to a business analyst from a vendor operating as the product owner on behalf of an external client.