I live in Hamburg and while maybe not all over Germany you can take the bike with you inside the train, you definitely can in HVV trains in Hamburg:
The UK Foreign Office (mirror) advises this:
When travelling in Pakistan, you or your travel company should contact
the local authorities of your destination in advance to check the
local security situation. They may arrange police protection as
necessary and will advise whether you need a No Objection Certificate
issued by the Pakistani Ministry ...