Jim Goodwin's side failed to score a goal from open play for a third successive game and a 4-3 success on penalties was not enough to keep the Ladbrokes Premiership side in the competition.
The result means Saints are now unable to finish top of Group H and fixtures still to be played elsewhere means they can not be one of the four best runners-up.
Saints made one change from the side that had drawn at Lowland League side East Kilbride the weekend, with captain Stephen McGinn replaced by Cody Cooke.
They were forced into another early switch when Cammy MacPherson injured his shoulder, with Nicholas McAllister handed his debut in his place.
McAllister almost enjoyed the perfect start but could not steer his header on target.
Kyle Magennis was next to threaten but saw his effort held.
Rovers then created a terrific chance as Euan East beat McAllister and centred for Scott Roberts, whose goalbound effort was blocked by Magennis.
The visitors responded with a driven shot from Jack Baird that was saved and then a Magennis header that was cleared off the line.
Rovers continued to push for a goal of their own and Ross Clarke was unlucky to see his long-range shot drift wide.
Saints could have scored right on the half-time whistle when Flynn played in Danny Mullen but his shot was well saved.
They opened the second half in similar fashion, Magennis' long-range effort drifting just wide before Rovers almost went in front when Roberts' volley struck the top of the crossbar.
That took it to penalties where Bryan Wharton and Smart Osadolor failed to score for Rovers and Saints were successful with all four of their efforts, but it was little consolation.