Tremorsense reveals the location of invisible attackers; it doesn't offer protection from sneak attack damage
The extraordinary ability tremorsense says that it
can automatically pinpoint the location of anything that is in contact with the ground. Aquatic creatures with tremorsense can also sense the location of creatures moving through water. The ability’s range is specified in the creature’s descriptive text.
Pinpointing a target's location doesn't negate the concealment granted by an effect like the spell invisibility. A creature with tremorsense that pinpoints an invisible creature's location can make attacks against an invisible creature (albeit with a 50% miss chance) without first locating the invisible creature using other methods (like flailing around like an idiot). Being able to make such attack semi-accurately doesn't make the creature with tremorsense immune to sneak attacks. The creature with tremorsense still can't see what the invisible creature is doing.
Example 1
Abe, lacking tremorsense, is unaware of Bob because Bob is invisible through an invisibility spell.
- Surprise Round: Bob stabs flat-footed Abe. Bob's invisibility spell ends.
- Round 1: Initiative checks are made. Bob acts then Abe acts. Bob takes the full attack action and makes several attacks versus flat-footed Abe. Abe dies.
Example 2
Abe, having gained tremorsense 30 ft., is aware of Bob despite Bob's invisibility spell.
- Round 1: Initiative checks are made. Bob acts then Abe acts. Bob takes a move action to get into position then takes a standard action to make a standard attack against flat-footed Abe. Bob's invisibility spell ends. Abe take a 5-ft. step away from Bob and takes a standard action to cast the spell finger of death on Bob. Bob makes a Fortitude saving throw, fails that saving throw, is dealt 200 points of damage, and dies.
Example 3
While affected by an invisibility spell Bob teleports adjacent to Abe. Abe, possessing tremorsense 30 ft., is aware of Bob's presence.
- Round 1: Initiative checks are made. Bob acts then Abe acts. Bob takes the full-attack action to make several attacks against flat-footed Abe. After the first attack, Bob's invisibility spell ends. Abe, who has yet to act, remains flat-footed. Bob continues his full attack action, still his dealing sneak attack damage to flat-footed Abe. Abe dies.
Example 4
While affected by an invisibility spell Bob teleports adjacent to Abe. Abe, possessing tremorsense 30 ft., is aware of Bob's presence.
- Round 1: Initiative checks are made. Abe acts then Bob acts. Abe can't target Bob with the spell finger of death because, while Abe knows Bob's location, Abe can't actually see Bob. Abe, instead, uses flame strike to affect an area so as to catch Bob in the spell's effect. Bob makes a Reflex saving throw, succeeds on the saving throw, and takes no damage because of his extraordinary ability evasion. Bob takes the full-attack action to make several attacks against Abe. The first attack (which must be at Bob's highest base attack bonus against Abe) deals sneak attack damage: although Abe is no longer flat-footed Bob still benefits from the spell invisibility. After that first attack, however, the invisibility spell ends, and Bob's remaining attacks don't deal sneak attack damage.
To be clear, I've omitted a host of things from these examples to make them concisely address the question, chief among them the Perception checks that Abe gets against Bob to help him survive the attack from the invisible ninja.