Since you are not interested in the smaller Persons, you need to store only the larger person. There are two ways to build it: one is to hardcode two relations, the other one is to recursively code it with a counter variable.
Version one: Z is taller than Y, Y is taller than someone.
tallerThan2(Z):-
tallerThan(Y,_),
tallerThan(Z,Y).
For the fact base
tallerThan(marge, homer).
tallerThan(homer, bart).
tallerThan(bart, lisa).
tallerThan(lisa, maggie).
tallerThan(abe, maggie).
tallerThan(marge, abe).
the output is
?- tallerThan2(P).
P = marge ;
P = homer ;
P = bart ;
P = marge ;
false.
The second way is to count the number of relations. You know of person Y that he or she is taller as at least NN people. If person Z is taller than Y then Z is taller than at least N = NN+1 people.
taller(Y,1) :-
tallerThan(Y,_).
taller(Z,N) :-
tallerThan(Z,Y),
taller(Y,NN),
N is NN+1.
Now the test:
?- taller(P,2).
P = marge ;
P = homer ;
P = bart ;
P = marge ;
false.
Is the same. marge appears twice in the list since she is taller than homer and taller than abe; both are taller than maggie.