A creature with the special ability grab cannot use that ability if it makes a trip attempt
The special ability grab says, in part, that
If a creature with this special attack hits with the indicated attack (usually a claw or bite attack), it deals normal damage and attempts to start a grapple as a free action without provoking an attack of opportunity.
Pathfinder says that natural attacks
fall into one of two categories, primary and secondary attacks. Primary attacks are made using the creature's full base attack bonus and add the creature's full Strength bonus on damage rolls. Secondary attacks are made using the creature's base attack bonus −5 and add only 1/2 the creature's Strength bonus on damage rolls.
A creature making a trip attempt—even if making that trip attempt with a natural weapon—is not making an attack with the "indicated attack" in the creature's statistics block as required by the special ability grab. The creature's instead making a trip attempt.
Because of the vast amount of material available for Pathfinder, I'm certain there are creatures with attacks that are exceptions to this, but in general this holds true for the grab special ability. The grab special ability usually won't activate on a trip, much like it also wouldn't activate on a successful disarm, reposition, sunder, or initial grapple attempt.