A baron, or any higher noble, usually outranked a knight. Noble rank was a title in its own right, while knighthood was a military honor. The word lord is less precise, though. A knight who held a manor could be called its lord, so the answer depends on which sense of lord is meant.
What a knight was
A knight was a mounted warrior who had been formally made a knight, often through a ceremony called dubbing. Most knights trained first as squires. Many held land in return for military service to a lord, so they were landholders as well as fighters.
Knighthood was not hereditary in England. A son did not automatically inherit the rank.
What lord meant
In the formal sense, a lord was a noble with a title of baron or higher, such as an earl or a duke. In a looser sense, a lord was any man who held a manor and had tenants who owed him service. A knight who held a manor could be called its lord, so the same man could be both a knight and a lord.
Where a baron fits
The baron was the lowest rank of the peerage, but it still sat above knights. Medieval barons were among the king’s most important tenants, part of the medieval feudal hierarchy, and the greater barons were summoned to parliament. That put them in a different class from most knights.
Can a knight become a lord?
In the loose sense, yes, and it was common. A knight could gain land by grant, by marriage or by inheritance, and then be called lord of the manor. Gaining a formal noble title was much rarer and usually depended on the king’s favor.
Land and money shaped who became a lord, which is why medieval wealth is so closely tied to rank.
Baronets: a later rank
Baronets are sometimes confused with barons. The baronetcy was created in 1611 under King James I. A baronet’s title is hereditary and sits between a knight and a baron, but a baronet is not a member of the peerage. The rank did not exist in the medieval period.
The short answer
In most cases, a baron or higher noble outranked a knight. A knight could still be a lord of a manor, and knights were a central part of medieval armies.