Expressions like a<b<c are interpreted as (a<b)<c which turns out to compare the logical result from a<b (either 0 or 1) with c. To test if the value variable fan is less than T3 and T5 use the condition as (Fan(i)<T5(i)) && (Fan(i)<T3(i))
Your snippet would be like,
for i=1:10000
T3(i)=datasample(ageT3,1);
T5(i)=datasample(ageT5,1);
Fan(i)=datasample(ageFan,1);
if (Fan(i)<T5(i)) && (Fain(i)<T3(i))
Ages(i)=unifrnd(Fan(i),T3(i))
else
Ages(i)=NaN;
end
end