Your answer sounds like it is right there in the error message:
1: In Ops.factor(TimeA, TimeB) : < not meaningful for factors.
factor
s don't have an explicit numeric value for comparison's sake. Consider:
factor("chicken") < factor("beef")
#[1] NA
#Warning message:
#In Ops.factor(factor("chicken"), factor("beef")) :
# < not meaningful for factors
You're comparing things which aren't mathematically comparable (though chicken is clearly the tastier meat if you ask me). If you are comparing unformatted time values as @Metrics suggests, you are essentially repeating the same problem as above.
factor("09:05:10") < factor("09:05:20")
#[1] NA
#Warning message:
#In Ops.factor(factor("09:05:10"), factor("09:05:20")) :
# < not meaningful for factors
But if you specify the values formally as date/time values, which are essentially numeric values, then you are sweet:
as.POSIXct("09:05:10",format="%H:%M:%S") < as.POSIXct("09:05:20","%H:%M:%S")
Just remember, unless you can represent your data sensible/meaningfully in a numeric form, then you can't sensible/meaningfully check if one value is larger or smaller than another.