Her hair was tied back in a bow commonly conveys “by means of a bow (made of ribbon or the like).” It can equally idiomatically be restated as Her hair was tied back with a bow.
It wouldn’t be wrong to use your sentence to describe your first photo, but that interpretation would come as a surprise to most listeners or readers. To describe the situation shown in the photo, one would normally say it differently. Maybe something like
- Her hair was formed into a bow in back
- Her hair was done into a bow shape in back, or
- She wore her hair itself tied as a bow.
These longer versions provide the more precise descriptions to highlight the unusualness of that hairstyle.
I hasten to add, though, that it’s perfectly idiomatic to say things like
- Her hair was pulled back in a braid and
- She wore her hair tied back in a bun.
But in those cases it’s understood that there’s no device involved. Just the hair itself.