When you delete tickets, everything inside it will get deleted.
This process is not synchronous. That means there could be a delay.
We've tested against millions of tickets. An attachment is deleted once a ticket is hard deleted.
It doesn't matter if the attachment is inline (shown between your comments) or as an actual attachment.
Zendesk follows a two-step process for ticket deletion.
1) A ticket is soft deleted
2) A ticket is hard deleted
When step 1 is completed, the attachment is still stored –if you need to recover it– but not accessible by anyone.
When step 2 is finished (30 days after step 1), the attachment is deleted –after a few days– and is no longer available to anyone.