Yes, the German consulate will likely have an office or at least some way of contact. You may also need to report the loss to the police - so do that first to avoid wasting time.
I am a UK citizen and had my passport stolen in Spain, I got a temporary travel document sorted the next morning.
I know from friends that Germans can get a travel pass issued in one hour at the German Int’l. airports. Maybe the same can be done in German consulates?