The key here is your children's teacher. S/He is the one you have to convince that your children will be able to hit the ground running in Gymnasium. For a teacher to give a Grundschulempfehlung for Gymnasium in Baden-Württemberg, the child has to have average marks in German and Maths of 2.5 or better in the report card issued in the middle of year 4. Right now your children wouldn't even earn Grundschulempfehlung for Realschule, which requires average marks of 3.0 or better in German and Maths, so it might be wise to have admission to Realschule as your/their initial (more immediately attainable) goal and put your kids into a school where they can swap into the Gymnasium stream later on (e.g. by year 7) if their performance warrants it. The Internationale Gesamtschule Heidelberg would be one such option.
You might consider asking the children's year 3 teacher whether it would pay to have them repeat year 3 in hopes of improving their marks and thus their likelihood of gaining entrance to Gymnasium. AFAIK, year 3 can be repeated, but year 4 cannot. It's relatively common for children to repeat a year of primary school in order to increase their chances of admission to Gymnasium (or Realschule, as the case may be). It would be good to express your concerns and hopes to the teacher now and see what kind of feedback (beyond the marks) s/he can offer. Which reminds me - what descriptive comments do your children get in their report cards? Those comments about personal characteristics and individual and social behavior are also part of the recommendation, and if your kids are really ambitious and hard-working, having comments to that effect might help, especially if your children seem to be borderline cases, mark-wise.