They were still in a position of great peril, since they could not expect to embark and cross the stream without suffering tremendous loss from the enemy before whom they would be flying.
The meaning of "fly" here is this one:
American Heritage Dictionary "fly'
intransitive verb: c. To flee; escape.
The meaning of "before" here is simply "in front of", that is they were confronted by their enemy, who were pursuing them.
So, the phrase "the enemy before whom they would be flying" means "the enemy they would be running away from."
The verb form "would be flying" is used because the sentence contains an implied conditional, that is, it has an "if" condition that is not explicitly stated in the sentence. In this sentence. The implied "if" condition can be stated: "if they embarked and crossed the stream". If they did that, then they would have losses from the enemy.
For other examples of implied conditionals, see here:
mikeandcate "implied conditional"