This can be simplified to:
/**
* @param \Magento\Framework\Indexer\ActionInterface $subject
* @param array $ids
* @return void
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function beforeExecute(\Magento\Framework\Indexer\ActionInterface $subject, $ids)
{
$this->context->registerEntities(\Magento\Catalog\Model\Category::CACHE_TAG, $ids);
}