Clarification: this applies to users in the WordPress administrator role. A test with “regular” users seems fine.
I should add this appears to be a bug in Ultimate Member. Ultimate Member lets me check a box on media that says “Restrict access to this post?” but it doesn’t do anything.
@missveronicatv Thanks. I was looking for a solution that would restrict media content to members, not just admins and the file’s author.