Thank you @fvu for your suggestions. In the meantime I have found a solution that works for me. I simply print
the locked file to another .pdf
file, using the printer software, and the destination file is identical but unlocked. I can open it in LibreOffice Writer, and I could edit it if I wished.
To do what I really want, that is to extract some of the data, I can set up the print job to include just the pages I need, so the file size can be kept to a minimum. No need to involve LibreOffice or any other software for this task.
The process is simple, and probably no more complex than any other method would be.