I think your question is based on two possible confusing relationships. First a "calorie" is different from a "Calorie"; and, second, there is a missing variable that Strava uses but you can't see: the assumed gross metabolic efficiency (or GME).
Strava's energy output measure is Joules or kilojoules. A joule is a watt-second, so if your first ride lasted 42m41s, that is 2561 seconds. If you expended 363 kJ in 2561 seconds, that is an average output of 363000/2561 = 141 watts over your ride. If you do not have a power meter on your bike this is an approximation that Strava makes from your information about the route you took, your total weight, your total time, and assumptions about your aerodynamic and rolling drag. Strava estimated your second ride to have expended 317 kJ over 3050 seconds, or an average output of 104 watts. If you weigh 115kg, that means Strava estimates your average output for your first ride at 141/115 = 1.22 watts/kg, and your second ride at around 0.9 watts/kg.
In American English, dietary guidelines often label kilocalories as "Calories" with an uppercase "C." That is, a "calorie" (lowercase "c") is the amount of energy needed to raise the temperature of 1 g. of water 1 deg Celsius, and a kilocalorie (or "Calorie" or "food Calorie") is the amount of energy needed to raise the temperature of 1 kg of water (=1 liter) by 1 deg. Celsius. There are 4 kilocalories (=4 food Calories) of energy in a gram of carbohydrate or protein and 9 kilocalories per gram of fat.
Your memory is correct: in a straight energy conversion there are about 4.185 joules per calorie, or 4185 joules per kilocalorie (="Calorie"). However, the human body is not 100% efficient in converting food Calories into energy. In fact, gross metabolic efficiency (GME) in humans is generally in the range of 19-24%. That is, only about 19-24% of the food Calories we consume are converted into energy we can use -- the rest is converted into heat.
Strava is assuming a value for GME of 21.4%, about the mid-point of that observed range of gross efficiency.
Thus, 363kj of energy output = 86.7 kilocalories of energy output, but at a GME of 21.4% a rider would need to consume about 86.7/.214 = 405 food Calories to maintain energy balance.
Likewise, for your second ride, 317 kj of energy output = 75.7 kilocalories of energy output, but a rider would need to consume 75.7/.214 = 353 food Calories to maintain energy balance.
If your own personal gross metabolic efficiency differed from 21.4%, you would need to consume slightly different amounts of food Calories to maintain equilibrium in weight.