Bagnaia could have won the championship in Sunday’s 20-lap Malaysian GP if he outscored Yamaha’s Fabio Quartararo by 11 points.
The Ducati rider did win the race, but Quartararo finished third to keep his title hopes alive going to the final round in Valencia, with 23 points now the gap between the two.
In recent races it has become apparent that Ducati has instructed its riders to be careful when racing with Bagnaia, but has stayed out of controlling battles for victories and podiums.
While Ducati management looked pensive on the pitwall on Sunday at Sepang, Bastianini was seemingly given no instructions not to race Bagnaia, with the Gresini rider battling hard and hounding his future teammate to the chequered flag.
Bastianini admits he had to judge any moves on Bagnaia with the championship in mind, but says he never intentionally stayed behind the factory Ducati rider on the last lap having been close to a move on the outside of Turn 9.
Asked if he planned a last-lap attack on Bagnaia, Bastianini said: “I was really close, especially in the last lap, but I think it was difficult to catch him in the last part of the track and it was important for me to remain close to the first.
“At Turn 9 I tried to go up the inside, but it was difficult, so I went for the outside.
“Yes, I like to attack, but always careful because for Ducati this title is important.
“I tried to overtake Pecco again in the last lap but it was a little bit dangerous.
“Sometimes we have to see also the other questions, he battles for the championship and it’s like this.”
Bagnaia’s seventh win of the season means he simply needs to finish 14th in Valencia and will be champion regardless of Quartararo's result.
The Ducati rider leaped up from ninth on the grid to second at the first corner after taking a “risk” under braking for Turn 1, and inherited the lead on lap seven when poleman Jorge Martin crashed out at Turn 5.
Bagnaia admits Martin’s pace at the start was too much for him anyway, while noting the Bastianini battle was the “hardest” part of the race.
“The reaction on the lights was really great but also the first braking I risked a bit to be in front, and this helped me a lot to fight for the win,” Bagnaia said.
“Jorge was with an incredible pace at the start, forcing a lot, and after two laps trying to follow him I just said I can relax a bit because for me it was too much.
“When he crashed, I just tried to manage the tyres a bit, Enea was forcing a lot.
“It was one of the hardest parts of the race when he overtook me, and it was quite difficult to follow him at the start because he was with more traction in the fast corner, I was with more traction in the slow corners.
“But I was braking so hard, so I think the braking was the thing that helped me to win the race today.”