The battery terminals did not have pole markings – where is the plus and where is the minus. Can they be identified with a compass?

Yes, you can, the northern part of the compass needle will indicate a plus.
The compass will respond to a magnetic field that forms around a conductor through which electric current flows. Therefore, when the battery is disconnected from the consumer, the current does not flow. In order to determine the direction of electron motion (and hence the polarity of the current source), it is necessary to connect a consumer designed for the voltage of this battery (the consumer can be a conventional incandescent lamp, which does not require observing the polarity of the power source). Accordingly, in this case, it will be possible to determine where plus and where minus using a compass.

Remember: The process of learning a person lasts a lifetime. The value of the same knowledge for different people may be different, it is determined by their individual characteristics and needs. Therefore, knowledge is always needed at any age and position.