It really depends on your interests. I agree with the previous poster who recommends researching both cities and looking at photos and watching videos.
I love both Madrid and Lisbon. If you don't think you will visit Portugal at a later date, then perhaps Lisbon would be a good choice. Lisbon is very different from Madrid visually and architecturally. It is smaller than Madrid so easier to get around. It's very different from the larger European capitals. It is a hilly city with beautiful tile work and wave-patterned cobblestone side walks and squares. There are quite a few miradouros (viewpoints) where you can sit, order drinks, and enjoy the scenery. There are some important and very lovely sites, such as the Gulbenkian Museum, Tile Museum, and Coach Museum, and more. Belem on the river is very interesting with the gorgeous Jeronimos Monastery, The Discovery Monument and Belem Tower. The Alfama district is the oldest neighborhood in Lisbon because it wasn't destroyed by the earthquake of 1755. It's so interesting to wander around the Alfama where people live and you see children riding bikes on the few flat areas and clothes hanging from balconies.
If you are art lovers, Madrid has many outstanding art museums. We loved wandering through Retiro Park, stopping for Sangria, and visiting the Royal Palace. Madrid is larger than Lisbon and more majestic looking.
You can take a short train ride from Barcelona to Madrid. You would have to fly from Barcelona to Lisbon. Not sure if that makes a difference to you. If you choose Lisbon, make sure you have very good walking shoes with good soles for the hills. Taxis are plentiful and inexpensive if you get tired of the hills in Lisbon. I was able to manage despite having arthritis in my hip. Had hip replacement surgery a year later.