Will these two transistors (BC558A and BC558B) function in the same way?
tl;dr For this circuit, it doesn't appear to matter at all. For a precision analog circuit, it may matter if the circuit is dependent on the beta/hFE parameter.
For the BC558 transistor in particular, the datasheet indicates the following behavior for the Hfe parameter:
This parameter relates the collector current to the base current as a ratio. Parts labeled BC558A are guaranteed to have Hfe within one particular range; parts labeled BC558B are guaranteed to have Hfe in a different range. Beyond that, there are no significant differences--they don't have different shelf life, and all of the other datasheet parameters will still hold across these series.
However, based on the circuit shown in your question, this parameter is not strongly relevant; it appears that the transistor is being driven fully-on or fully-off and as a result this parameter has only a weak effect on the circuit's behavior. Moreover, the transistor is attached to optoisolators that themselves have very imprecise characteristics unless binned in the same way.
However, if you are trying to construct an analog circuit where this parameter is important, you may need to select a particular series of this transistor (A, B, or C) and remain within that series. Even then, many analog topologies are designed to be insensitive to certain transistor parameters to avoid this issue.
if it just says PNP transistor without naming any particular one, it's likely just about any reasonably-selected one will do. You could use a BC558, a 2N3906, you might even get away with a TIP42 if it's not too picky about low β.
Like @isdi said in the comments, a suffix on the end of a part number usually just indicates a better product than the original, but one that is otherwise interchangeable with the original. Think of it like a "version 1.1" of the device.