Selecting multiple objects and pushing lock button in properties panel "transformation" locks the axis only for one object in the selection of objects.
You can apply the same "lock" to multiple objects by copying contraints from one object to others, but you have to "lock" your reference object with constraints (look the constraints tab in the selected object panels- right side of the default view) as in the image below.
Since the last selected object is the "active" object, you can get what you wish in this way: apply desired locks to one of the objects. Then select all the others, and as last also the locked one.
Then use the "copy constraint to selected objects" (use the space bar to find the command, or look under the menu "object > constraints").