There are 2 reasons your code is not working.
First of all, there are syntax errors. Maybe you've just given us two snippets, but if that's not the case then you have php tags inside php code, and you've omitted the closing bracket of the foreach statement.
Secondly, getChildrenCategories() does not load all category data, just the very basics. So getImageUrl() returns nothing because image data was not loaded.
The funny thing is that Marius' answer solves both of these problems, yet you say it still won't work. In which case perhaps you need to refresh you cache and/or indexes.
System > Cache Management > Additional Cache Management > Flush Catalog Images Cache
System > Index Management > Category Flat Data
Also, I gather this code is inside a template, in which case you might have to refresh the blocks html cache too:
System > Cache Management > Blocks HTML output
Combined with Marius' code, this should do the trick.
PS. If the code isn't inside a template then that opens up a whole load more possible explanations, e.g. Blocks and Models should most probably be using
return instead of
** EDIT **
PPS. The title of your question says "thumbnail", rather than "image". While categories do have thumbnails, the Magento team have for some reason neglected to write a getThumbnailUrl() function to complement getImageUrl() - at least this is true in CE 1.7 and 1.8, haven't checked 1.9 yet. So if it really is the thumbnail that you want, copy Mage_Catalog_Model_Category::getImageUrl() and modify accordingly.