In «مَرَرْتُ بِبَعْلَبَكَّ», the second element is accusative because it ends in fatḥah.

Al-Murakkabāt — Compound Numerals, the Twelve Exception and Declining Baalbek