My memory about this story is rather short. I only remember the following points :-
The story was in a collection of stories.
In this, a robot/AI of some sort traps 2 people on a spaceship and sends them off.
On the ship, they realise that they are travelling in space unaided and try to scour the ship for any life-saving-essentials they can find.
The AI admits to some other people what it has done and assures them that the 2 men have all the essentials that they need.
The 2 men suddenly find a sort of cabinet that they claimed wasn't there before. In that, they find beans and milk.
The AI/robot was named "The Brain".