Some calculations using the input parameters you gave.
Option A: Assuming a 3-year PhD, you are earning €36,000 a year, or €108,000 over the duration of the PhD.
Option B: Assuming a 3-year PhD, you are losing €24,000 a year, or €72,000 over the duration of the PhD.
Let's assume that if you take option A, you go on to a job that pays a discretionary income of €3,000 a month (i.e. 3000 after all taxes and basic spending are deducted). If you take option B, you instead get €3,000 + X a month, where X is a positive number. (This is an assumption, and there's no guarantee that it will indeed happen.) Further, let's assume you save the entire sum, that you graduate at age 30 and work until 65, and your monthly salary never increases faster than the rate of inflation.
Next we assume that you already have enough money saved such that if you take option B, you start your working life with €0 (no student debt). That means that if you take option A, you start with €180,000. The average return of the S&P 500 per year over the past 90 years is 9.8%. This is the rate of return at which you're increasing your savings.
Now we can use a compound interest calculator to figure out how much money you have at retirement. Given €180,000 starting principal, €36,000 annual addition, 9.8% interest rate, and 35 years to compound, Option A gives €14,978,512.10. With option B, you have €0 starting principal, unknown annual addition, 9.8% interest rate, and 35 years to compound. Fiddling with the annual addition yields the result: to get the same ~€15 million retirement fund, you need an annual addition of €52,700.
You'll need to vary the parameters to fit your situation of course, but the result of this analysis is typical. Your monthly discretionary income needs to be at least ~€4392, or X must be at least €1392, for Option B to be competitive with Option A.
Do graduates with a degree from a top 10 university earn €1392 more per month than graduates from a lower-ranked university? You can ask around, but I'm pretty confident the answer is "no" unless you are in a field where average monthly earnings are five figures or greater.
tl; dr: take the funded position.