The phrase "It's the Economy stupid" comes to mind here.
Every game you need to have some idea on how your economy will succeed.
CE= Financial = Cottage spam + Colossus + windmills are a great start.
SE= Philosophical = Caste System + Pasificism + Great Library and more wonders are a great start.
Trade Economy = The Great Lighthouse, Currency, Castles, Free Market, Cothon (when Carthrage).
EE= The Great Wall, get Alphabet and steal techs or treasury.
IND leaders can build wonders for fail gold.
IND or SPI leaders build UofS and Spiral Minerat for gold and research.
SPI definitely found at least one religion and spread it everywhere.
Conquer cities, burn, if, you can't afford them.
Raid Improvements for gold.
These ARE the plans.
I do at least one of these, usually, multiple, every game.
It sounds like to me, you started without a plan and ended up where you are.
First mistake.
Playing Civ, by Planning your Economy, and you shall surely be victorious.
Playing Civ, hoping to gain an Economy, and you shall surely perish.
Some Civ applied Sun Tzu.
To help you where you are at, try to do as much of the above, that are still possible.
Certain wonders are built, capture those cities.
Castles are obsolete, but, free market is still available, build harbors, maximize trade revenue, especially to overseas cities.
Spying for techs or gold, will still be useful.
Found any remaining religion or capture any holy city and convert.
Build UofS and Spiral Minerat, if, still available.
You can still run specialists, but, they will have a lessening effect at this point.
Great Merchants will get you some gold to be able to keep your tech slider high.
Golden ages for Artists. Prophets too, After, you have built your religious building.
Conquering cities for gold will still work, and Raiding Improvements for gold too.
In 'Always War' games, Raiding is what I do all game.
Sometimes the only way to out tech the AI, is to destroy their improvements, until, your Improvements are greater than theirs.
This will work with whomever you are at war with in any game.