Itachi knew they weren't the same person. His lecture to sasuke does as much to confirm the literal presence of the real madara prior to emergenceof a new personality (new to him in context of his encounters). Keep in mind, itachi can't afford to divulge the entire truth to sasuke who not only couldn't reach itachi's level of knowledge by his own power (would sasuke have been able to detect madara too?) Sasuke was even still following an immature and destructive path where if he knew the truth then he may follow that path to ruin. Letting sasuke discover matters in his own time seems to be working.g out for the best, especially since the impression was already given that tobi is pathetic, which is all the impression itachi needed to give to sasuke.
I believe itachi was not confused between the separate identities of madara and tobi. He may not have known of obito but at least knew tobi was not the real madara. He cleverly informs that they are of the same accord while hiding the fact they are different people.
The real question is, do you think tobi was more powerful than itachi? When itachi was living would tobi REALLY be able to put one over on itachi who could detect the real madara when no other uchiha could? No rinnegan, no 10 tails, nobody left to protect, tobi at suchva time isn't on itachi's level, he just had the privilege of having been told more cool sh*t by madara. Compared to itachi, obito was still a flunky uchiha before he was GIVEN the tailed beasts. Itachi did some of that dirty work too, i didn't see tobi battle jinchuriki.
Point is, tobi ain't foolin' da man.