境界 and 限界: a dividing boundary and a limit of ability
Compare the boundary between two villages with the limits of stamina felt after prolonged walking, preserving the object of each expression.
A boundary dividing areas
境界(きょうかい) means a boundary. 「二つの町の境界には、古い石の標識が残っている。」 says that an old stone marker remains at the boundary between two villages. It locates the marker where the villages are divided.
「仕事と休みの境界が曖昧にならないよう、夜は通知を切る。」 describes turning off notifications at night to keep the boundary between work and rest from becoming unclear. よう presents a purpose rather than guaranteeing a completed result.
A limit of ability
限界(げんかい) means a limit. 「長時間歩き続け、体力の限界を感じた。」 describes feeling the limits of one's stamina after walking continuously for a long time. 体力の identifies what is limited.
The feeling of a limit is stated, but stopping or the amount of further walking possible is not. This example concerns stamina rather than a numerical upper bound or a container-capacity calculation.
Dividing areas and reaching an extent
境界 in the village example divides two areas, while 限界 in the walking example concerns the extent of ability. Work and rest can also be presented as areas to distinguish.
Spatial uses can overlap, so one word is not always a line and the other is not always a number. These examples concern the areas divided and the stamina being limited.
Does 「長時間歩き続け、体力の限界を感じた。」 report crossing a village boundary or stopping the walk?
Show the answer and why
It states that the person felt the limits of their stamina. Its object differs from the 境界 between villages, and stopping is not explicitly stated.

