Unbalanced edge modes and topological phase transition in gated trilayer graphene