Brazilian youngster Vinicius opened the scoring with a cool finish in the 19th minute after missing an earlier chance and he hit the crossbar later in the first half.
Captain Ramos doubled Madrid's lead with a superb free kick, curling the ball over the wall and into the top corner to score his eighth goal of the league season and his 10th in all competitions.
Mallorca forward Luka Romero, 15, became the youngest player to make his La Liga debut when he came off the bench.
Real's fourth win in a row since the season returned took them back to the top of the table on 68 points after 31 games, level with Barcelona but ahead of the Catalans due to their superior head-to-head record.
Real coach Zinedine Zidane made four changes after Sunday's controversial 2-1 win at Real Sociedad, recalling Eden Hazard to partner Vinicius and Karim Benzema while handing Gareth Bale a first start since February.
Benzema and Vinicius formed a lively partnership and quickly found holes in Mallorca's defence.
Vinicius is often criticised for his poor finishing and squandered an early chance by taking too long to get his shot away but soon compensated by keeping his cool to beat Manolo Reina from close range after Bale laid the ball off.
He was played in by Benzema in a blistering counter-attack but instead of producing a simple low finish he tried an audacious chip which hit the bar.
"I'm very happy with the team's performance and my own," said Vinicius.
"I worked very hard at home to get in this shape. This run of matches is like a World Cup, you have to be in the right shape every three days and fired up."