Usually each Azure AD tenant operates independently in terms of password policies.
In your scenario , If the user logs in with credentials from their company's Azure AD, the policy from that Azure AD is applied.
If the user logs in with credentials from Company A's Azure AD, the policy from Company A's Azure AD is applied.
Hope this helps kindly accept the answer if it did thanks much.