Is it one single online contest for all sites even if registered for two separate sites?
Yes. There is only ONE SINGLE ONLINE CONTEST for all the sites.

How is ranking done?
There is a global ranking which is irrelevant. Site ranking is important where your team is ranked separately for each site. AT Amritapuri site, you may appear in 5th position, but for Chennai site, your rank may be different.

I have registered in two sites. How to participate?
It doesnt matter. You can participate in the online contest and your team is ranked separately.

What if team members are two sites are different except one member?
Its ok. This is not important from online contest point of view. Both teams can log in and participate in the online contest. Since the onsite dates are different, common member can participate in both sites.