Topologically nontrivial phase in the hexagonal antiperovskites A3BiB ( A =Ba,Sr; B =P,N)