For the issue, do you mean that you want to set the read-only permission to the files in the document library or to the attached file in the list item?
If in the document library, you can change the settings in the manage permissions settings. If in the list item attachment, you can set the permissions in the list item level.
If this still doesn’t work, please try to this:
File folder options-> file types-> choose the type of your file-> advanced-> open as read-only.
Hope this could help you!