There are only two trains from Algeciras (0843 and 1503). We want to bounce out of Madrid on to Toledo upon arrival in Madrid. Therefore, the late train from Algeciras is not a good choice. Is there a place to get breakfast near the train station in Algeciras? Can one get breakfast on the train to Madrid?
Was in Algeciras six months ago - a driving trip. But some pointers that may help. Spanish bars are THE place to go for morning coffee, pastries, tostada con tomate, and the Spanish potato tort. Forget all your American assumptions about bars. In three weeks in Spain 10/2012 we had breakfast about half the time in a bar rather than our hotel. Surely there will be a bar near or in the station.
There is a cafeteria service indicated on the morning train. I do not think there is a cafe at the station itself or within a few metres. Five minutes walk each way maybe. I would grab something immediately you see somewhere open for surety, or carry something of your own.
Algeciras train station has a cafe but it's not always open. The bus station just across the roundabout from the train station has a cafe that opens around 07.30. It's not beautiful but it does typical Spanish breakfasts such as pan con tomate y aceite. If you want I can check next time I'm there, which is often as I'm a car-less journo! If the Madrid train doesn't have a buffet car it should have a snack machine or trolley but either way you won't get anything much. People tend to bring their own. The trains have tables.
You should be stopping in Algeciras, a much-maligned city! You might like to read my blog about it: http://belindabeckett.com/sizzle-in-algeciras/