At draw of stumps on day two, Williams was not out on 122 while Martin was not out on 111 with the visitors's first innings score reading 268 for 2.
After losing two wickets early, Williams and Martin added 228 runs for the third wicket to set up a platform for a big total.
Williams hit 12 boundaries in his 198 ball knock while Martin had 19 fours to his credit in his 200-ball innings.
Earlier, Uttar Pradesh were all out for 346, adding 43 runs to their overnight total. For Baroda, Irfan Pathan Sr, Rakesh Patel and Pawar picked up three wickets each.
Uttar Pradesh (1st innings): (Overnight 303 for 6)
Rohit Prakash lbw b Patel 71
Jyoti P Yadav c Shah b Sumit Singh 4
Suresh Raina c Williams b Pathan 75
Rizwan Shamshad c Williams b Pathan 0
Gyanendra Pandey c Williams b Pathan 48
Ravikant Shukla c Powar b Pawar 45
Amir Khan c Williams b Patel 43
Piyush Chawla lbw b Patel 16
P Kumar c Martin b Pawar 22
Praveen Gupta not out 8
AW Zaidi c Williams b Pawar 0.
Extras: (B-4, LB-8, W-1, NB-1) 14.
Total: (all out in 107.3 overs) 346.
Fall of wickets: 1-12, 2-141, 3-152, 4-159, 5-235, 6-271, 7-309, 8-336, 9-340.
Bowling: Rakesh Patel 34-11-91-3, Sumit Singh 17-5-57-1, Irfan Pathan Sr 34-2-104-3, Kiran Pawar 17.3-3-58-1, Ajit Bhoite 5-0-24-0.
Baroda (1st innings):
Irshad Sindhi lbw b Zaidi 9
Connor Williams not out 122
Rakesh Solanki c Amir Khan b P Kumar 16
Jacbo Martin not out 111.
Extras: (B-4, LB-2, NB-4) 10.
Total: (For two wickets in 73 overs) 268.
Fall of wickets: 1-12, 2-40.
Bowling: AW Zaidi 17-2-57-1, P Kumar 18-2-61-1, Suresh Raina 1-0-9-0, Piyush Chawla 19-2-77-0, Praveen Gupta 13-3-38-0, Jyoti Yadav 4-0-11-0, Gyanendra Pandey 1-0-9-0.