Not quite so simple...
IANAL, however, the offence in question is the sale and distribution of counterfeit (not stolen) goods. If the knock-off-nokias were going to be sold in this country, HMRC would have, correctly, seized them.
However, since they were only in transit through this country, from and to other countries that do not have the same treaties regarding copyright and trademarks as us, they were not subject to our trademark laws. HMRC could have got themselves in quite a lot of trouble if they had impounded the phones, from their rightful owners.
As an aside, as I understand it, if I were to make my own mobile phone and stamp 'Nokia' on it, I would not be comitting a trademark offence until I tried to pass this off as a genuine Nokia, by either advertising or selling it as such. There was no 'passing on' as you put it, presumably the items in question were in a shipping container or similiar and happened to be on ther way from their point of origin to their destination via the UK.
I can understand the point being made by the HMRC that the law should be changed to allow the goods to be impounded in such cases. However, I disagree. If that container never passes through customs, except as part of its onward journey, it is none of our business whether or not the contents infringe someone else's IP. If the container were full of something more dangerous or highly illegal, such as human slaves or highly enriched uranium, the situation would be different. I suspect there are already laws that cover such cases.