They also have a quite a lot of similarities, both titles follow a super hero type stereotype, are fairly open world, except InFamous 2 is far far far bigger than AC. Both titles have something to do with curing a disease somewhere down their storyline, they have a main objective and side missions however InFamous 2 has far more things to do especially with the UGC additions, both have you upgrading certain abilities etc
For me everything in InFamous 2 was done far better than Batman, a lot of the gadgets and upgrades were pointless where as I used almost everything I was given in InFamous. The one thing I loved as well was the choices, in Batman AC there were so many points where you could make a choice but couldn't. The only time I remember actually being able to make any sort of decision in the game was in the Catwoman mission where I could choose to either save Batman or leave him by going either left or right. This should have been done a lot more through out the game to change it up.
InFamous allows for this type of decision and gets you more attached to the characters where as Batman just seems like I'm being forced to do what I need to do and not really being allowed to choose what to do apart from side missions. Controls, movements and combat is also a lot more fluid in Infamous over Batman, everything feels more polished and flows better. Enemies were also very lacking in AC there was hardly any variation apart from different skins.
Not to say Batman isn't a good game, it is I finished it so it held my attention long enough however it's not the all great game people make it out to be, there are titles that can stand on the same podium if not eclipse it and people should give them a shot. I see it turned into a game vs game comparison but yeah take it as you will.
Also for me Spiderman Shattered Dimensions while much more linear than AC was a more enjoyable experience :)