The “isTouching” method is protected, so you can’t access it from the World. You could “cheat” and create a public method which does the same thing. The alternative is to have the code in the object which both actors should touch.
if (isTouching(Actor1.class) && isTouching(Actor2.class))
{
((MyWorld) getWorld()).doSomething();
}