They weren't in the same lift at the same time and there are no cameras to show what each one did. The most likely theory is that they both touched the same surface, probably the lift button. It is unlikely that contamination occurred through respiration.
I read somewhere (I will try to find the source) that the aerosol vapour from breathing can carry the virus and the virus stays active for quite some time on those aerosol particles. That is a possible source of infection as these particles could remain suspended in the air of a elevator car for quite a while.