Smarty as almost all template engines has its own syntax.
As far as I remember (someone can correct me if I'm wrong) it was impossible to use some syntax in Smarty 2 and it was harder to code some obvious things from PHP. But now we have Smarty 3.1
In your question, you probably haven't assigned both categories and topics to Smarty so it couldn't work. The simple rule is that you need to assign each variable that you want to use in Smarty from PHP using $smarty->assign construct.
In your case you can simple do in PHP:
$topics = [];
$topics[9]['category_id'] = 'something';
$categories = [];
$categories['something']['category_id'] = 798897;
$smarty->assign('topics', $topics);
$smarty->assign('categories', $categories);
to assign both arrays from PHP to Smarty and in Smarty you can simple do:
{$categories[$topics[9]['category_id']]['category_id']}
As you see you display this value almost the same as in PHP (instead of echo you simple use { at the beginning and } at the end) ant that's it.
You can however use also a bit simpler syntax in Smarty:
{$categories[$topics.9.category_id].category_id}
Instead of using [..] you can use . but when using as above other variable as index you need to still use [..] syntax
{$categories[$topics[9]['category_id']].category_id}? probably would make things easier in.tplif you assign the variable in control anyway