"Dignity" vs. "respect"
Dignity is honorableness, a quality of the person being elevated. Respect is a viewpoint, a quality of the person doing the elevating.
In your example context, there is considerable overlap of connotation, and one could be used in place of the other. In other contexts, it would be hard to do so. For example, we can refer to the dignity (honorableness) of an action, but can’t meaningfully substitute respect. And we can refer to things differing in some respect (from some viewpoint), but can’t meaningfully substitute dignity.
Dignity identifies a worthy, high, and honorable condition. When person A treats person B with dignity, it means person A acknowledges person B’s dignity (worth or value). This is also seen in the verb dignify: if I say “I refuse to dignify that with an answer”, I mean I refuse to treat the question as worth answering: it’s not me, but the question itself that lacks dignity.¹
Respect identifies the act of paying attention or proper consideration, and by extension the act of viewing someone as worthy of such consideration. When person A treats person B with respect, it means person A takes proper notice of person B, according person B due care and honor. This is also seen in the verb to respect: if I say “I refuse to respect that decision”, I mean I refuse to treat the decision as worthy of respect: it’s me, not the decision, that lacks respect.²
It is helpful to look at the etymology of these words, because their meanings reflect their history. Dignity comes from the Latin noun dignus, “worth”, and is related to other valuing words such as dignitary, dainty, deign, disdain, and indignation.³ Respect comes from the Latin verb respicere, literally “look back at”, and is related to other viewing words such as spectator, spectacles, and inspect.⁴
It might be easier to have answered this question had you given a little more detail about the context in which you read it - but, with that proviso, here's my two-pennyworth!
I agree that there is considerable overlap between the two terms, dignity and respect, yet they do often be seem to be used together. One context that is fairly common and topical in the UK at the moment is in the treatment of patients - and particularly elderly patients - in hospital.
In that particular context, I tend to think of dignity as referring to the manner in which they are 'physically' treated or handled, e.g. handling them in a private cubicle with curtains properly drawn, treating their physical body with respect and privacy as far as possible even when having to help them dress/undress or having to help with private and/or intimate functions.
On the other side, I think of respect as 'dignity' for their 'inner person', for their wishes and desires: listening to what they want and to their preferences, and responding to them, even if you cannot meet their wishes or they are inappropriate for medial reasons - not just doing what you think is necessary and ignoring what they are saying. Give them at least a moment of time, rather than ignore them completely.
That's how I distinguish between the two in that particular type of circumstance: whether others agree, or can explain the differences in clearer terms, ....