Hi,
Let's start with collecting some info so we will be able to provide more focuses options. For each point please check both machines and provide the information
(1) Machine resources: What template did you use to create the VM (if you changed the default resource then pls elaborate)
(2) What is the version of SQL Server?
Execute: SELECT @@VERSION
(3) What is the full code to create the JOB ?
(4) If the job uses tables then please provide the DDL of the tables + amount of rows + DML for a few rows, so we will be able to reproduce the scenario in our servers
(5) Make sure that you execute the JOB using same level of user
(6) Check Waits, locks, deadlocks, blocking during the execution of the job - most likely another task is blocking the execution in one server
(7) rebuilt indexes and updated stats on both and try again
(8) Confirm no issues with machine level resources such as disk IO, CPU, memory, etc.
(9) Try to narrow the issue down as much as you can. Clean the jobs as you can and leave the part which lead to the issue - will be simpler to continue if the issue related to single query for example.
(10) Compare the Execution Plan in both machines
(11) Inform us if you have any other relation or object like AlwaysOn Availability, replication and so on
(12) SQL Server Management Studio contains an Agent GUI that can show us details on recent job outcomes, as well as the ability to monitor jobs in progress. In the Object explorer windows go to: SQL Server Agent -> Jobs -> Job Activity Monitor
use it on both machine and try to get more insights
...
If these will not help then you can follow this post and build a Job performance tracking solution: https://www.sqlshack.com/tracking-job-performance-sql-server/